Skip to content

Add cfg_select! formatting rules to the style guide - #160967

Open
traviscross wants to merge 1 commit into
rust-lang:mainfrom
traviscross:TC/add-cfg_select-formatting
Open

Add cfg_select! formatting rules to the style guide#160967
traviscross wants to merge 1 commit into
rust-lang:mainfrom
traviscross:TC/add-cfg_select-formatting

Conversation

@traviscross

@traviscross traviscross commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

We stabilized cfg_select! in Rust 1.95 but haven't yet stabilized formatting support. Let's add formatting rules for it to the style guide.

Our original FCP was in rust-lang/style-team#201 (comment) inclusive of #144323 (comment).

This PR extends those decisions with handling of more edge cases.

See also:

r? @joshtriplett

cc @rust-lang/style @rust-lang/rustfmt

We stabilized `cfg_select!` in Rust 1.95 but haven't yet stabilized
formatting support.  Let's add formatting rules for it to the style
guide.
@traviscross traviscross added the T-style Relevant to the style team, which will review and decide on the PR/issue. label Aug 12, 2026
@rustbot

rustbot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/doc/style-guide

cc @rust-lang/style

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 12, 2026
@rustbot

rustbot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

joshtriplett is not on the review rotation at the moment.
They may take a while to respond.

jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 13, 2026
…matting, r=jieyouxu

rustfmt: restrict `cfg_select!` formatting to the `nightly` release channel

Closes: rust-lang#160944

`cfg_select!` formatting was implemented in rust-lang#154202. The formatting diverged from what was outlined in the original Style FCP (rust-lang/style-team#201 (comment) and rust-lang#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: rust-lang#160967

r? @jieyouxu

cc: @traviscross
rust-timer added a commit that referenced this pull request Aug 13, 2026
Rollup merge of #160998 - ytmimi:nightly_only_cfg_select_formatting, r=jieyouxu

rustfmt: restrict `cfg_select!` formatting to the `nightly` release channel

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-style Relevant to the style team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants