Skip to content

rustfmt: restrict cfg_select! formatting to the nightly release channel - #160998

Open
ytmimi wants to merge 3 commits into
rust-lang:mainfrom
ytmimi:nightly_only_cfg_select_formatting
Open

rustfmt: restrict cfg_select! formatting to the nightly release channel#160998
ytmimi wants to merge 3 commits into
rust-lang:mainfrom
ytmimi:nightly_only_cfg_select_formatting

Conversation

@ytmimi

@ytmimi ytmimi commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Closes: #160944

cfg_select! formatting was implemented in #154202. The formatting diverged from what was outlined in the original Style FCP (rust-lang/style-team#201 (comment) and #144323 (comment)).

Since the 1.99 beta is scheduled to branch from main on August 14 I want to get this nightly formatting gate out so that we can correct the formatting issues before we promote the formatting to the beta / stable release channels.

Style Guide PR: #160967

r? @jieyouxu

cc: @traviscross

ytmimi added 3 commits August 12, 2026 13:37
…ghtly` release channel

Tests can use the following comment configuration to mark themselves as only
running on `stable` / `beta` release channels.

```rust
// rustfmt-stable: true
```

> [!NOTE]
> Using `stable` here since we already have an `ustable` variant for nightly
> only tests and I didn't want to refactor things now, but in the future I think
> we should refactor this to be more like:

```rust
// rustfmt-cfg_release_channel: {stable|beta|nightly}
```
These tests show that `cfg_select!` won't be formatted on `stable` or `beta`
release channels.
@rustbot

rustbot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

rustfmt is developed in its own repository. If possible, consider making this change to rust-lang/rustfmt instead.

cc @rust-lang/rustfmt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Aug 12, 2026
@rustbot

rustbot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

jieyouxu is currently at their maximum review capacity.
They may take a while to respond.

@ytmimi

ytmimi commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Since @jieyouxu is at capacity

r? @traviscross

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks
@bors r+ rollup p=1 note="ideally we don't want this to slip into beta"

View changes since this review

@rust-bors

rust-bors Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 0febbac has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2026
@jieyouxu jieyouxu assigned jieyouxu and unassigned traviscross Aug 13, 2026
@jieyouxu jieyouxu added the F-cfg_select `#![feature(cfg_select)]` label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-cfg_select `#![feature(cfg_select)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustfmt formatting of cfg_select! pending for Rust 1.99 diverges from style FCP

4 participants