rustfmt: restrict cfg_select! formatting to the nightly release channel - #160998
Open
ytmimi wants to merge 3 commits into
Open
rustfmt: restrict cfg_select! formatting to the nightly release channel#160998ytmimi wants to merge 3 commits into
cfg_select! formatting to the nightly release channel#160998ytmimi wants to merge 3 commits into
Conversation
…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.
Collaborator
|
cc @rust-lang/rustfmt |
Collaborator
|
|
Contributor
Author
|
Since @jieyouxu is at capacity r? @traviscross |
This was referenced Aug 12, 2026
jieyouxu
approved these changes
Aug 13, 2026
Member
There was a problem hiding this comment.
Thanks
@bors r+ rollup p=1 note="ideally we don't want this to slip into beta"
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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