Skip to content

Reject outer attributes on cfg_select branches#155734

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
qaijuang:cfg-select-doc-comment
May 8, 2026
Merged

Reject outer attributes on cfg_select branches#155734
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
qaijuang:cfg-select-doc-comment

Conversation

@qaijuang
Copy link
Copy Markdown
Contributor

@qaijuang qaijuang commented Apr 24, 2026

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 24, 2026
@qaijuang qaijuang force-pushed the cfg-select-doc-comment branch from fb8cf2e to 9c49112 Compare April 24, 2026 14:12
Comment thread tests/ui/lint/unused/unused-doc-comments-for-macros.rs Outdated
@qaijuang qaijuang marked this pull request as ready for review April 24, 2026 14:42
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 24, 2026

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 24, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 24, 2026

r? @JonathanBrouwer

rustbot has assigned @JonathanBrouwer.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 17 candidates

@qaijuang qaijuang requested a review from folkertdev April 24, 2026 16:59
Comment thread compiler/rustc_attr_parsing/src/attributes/cfg_select.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 25, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 25, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 25, 2026

📌 Commit 4bb2b07 has been approved by JonathanBrouwer

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 25, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 25, 2026
…=JonathanBrouwer

Lint doc comments in cfg_select branches

Fixes rust-lang#155701.
rust-bors Bot pushed a commit that referenced this pull request Apr 25, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #154803 (Fix ICE from cfg_attr_trace )
 - #155485 (Add an edge-case test for `--remap-path-prefix` for `rustc` & `rustdoc`)
 - #155659 (cleanup, restructure and merge `tests/ui/deriving` into `tests/ui/derives`)
 - #155696 (Add a higher-level API for parsing attributes)
 - #155734 (Lint doc comments in cfg_select branches)
 - #155769 (triagebot.toml: Ping Enselic when tests/debuginfo/basic-stepping.rs changes)
@fmease
Copy link
Copy Markdown
Member

fmease commented Apr 25, 2026

This PR allows more code to compile, so it's a language change and technically needs a T-lang FCP.

cc @rust-lang/lang

@fmease
Copy link
Copy Markdown
Member

fmease commented Apr 25, 2026

I'm sorry

@bors r-

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 25, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 25, 2026

This pull request was unapproved.

This PR was contained in a rollup (#155773), which was unapproved.

View changes since this unapproval

Copy link
Copy Markdown
Contributor

@folkertdev folkertdev left a comment

Choose a reason for hiding this comment

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

The FCP is very technically here, given this was just stabilized and I think not erroring on a doc comment in that position is very much in the spirit of the feature stabilization.

Nevertheless, let's at least let T-lang decide what they want to do here.

View changes since this review

Comment thread tests/ui/lint/unused/unused-doc-comments-for-macros.rs Outdated
@qaijuang qaijuang requested a review from folkertdev April 25, 2026 23:46
Comment thread tests/ui/macros/cfg_select.stderr Outdated
Comment thread tests/ui/macros/cfg_select.rs
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 26, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 26, 2026
Comment thread tests/ui/macros/cfg_select.stderr
Comment thread compiler/rustc_parse/src/parser/cfg_select.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 26, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 26, 2026
Comment thread compiler/rustc_parse/src/parser/cfg_select.rs Outdated
@qaijuang qaijuang requested a review from fmease April 26, 2026 16:07
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors squash

@rust-bors

This comment has been minimized.

* Lint doc comments in cfg_select branches
* test with multi-line doc comment

Co-authored-by: Copilot <copilot@github.com>
* Reject outer attributes on `cfg_select` branches
* address nits and gotchas

Co-authored-by: Copilot <copilot@github.com>
* one more test

Co-authored-by: Copilot <copilot@github.com>
* avoid snapshotting and classify recovered doc comments directly
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 8, 2026

🔨 6 commits were squashed into d42a92b.

@rust-bors rust-bors Bot force-pushed the cfg-select-doc-comment branch from c04993f to d42a92b Compare May 8, 2026 09:14
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

JonathanBrouwer commented May 8, 2026

@bors r+ rollup
I think all concerns are resolved now, since it's an error

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 8, 2026

📌 Commit d42a92b has been approved by JonathanBrouwer

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 May 8, 2026
rust-bors Bot pushed a commit that referenced this pull request May 8, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #156236 (resolve: Remove `MacroData`)
 - #156298 (Rename the unstable integer `extend` function to `widen`)
 - #154498 (turn some long-deprecated -C options into errors)
 - #155734 (Reject outer attributes on `cfg_select` branches)
 - #156123 (Simplify the creation of synthetic HIR.)
 - #156175 (Dep graph cleanups)
 - #156214 (Do not cache `lints_that_dont_need_to_run` across sessions)
rust-bors Bot pushed a commit that referenced this pull request May 8, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #156236 (resolve: Remove `MacroData`)
 - #156298 (Rename the unstable integer `extend` function to `widen`)
 - #154498 (turn some long-deprecated -C options into errors)
 - #155734 (Reject outer attributes on `cfg_select` branches)
 - #156123 (Simplify the creation of synthetic HIR.)
 - #156175 (Dep graph cleanups)
 - #156214 (Do not cache `lints_that_dont_need_to_run` across sessions)
@rust-bors rust-bors Bot merged commit 6133b7e into rust-lang:main May 8, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 8, 2026
@qaijuang qaijuang deleted the cfg-select-doc-comment branch May 9, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cfg_select! + doc comment gives cryptic compiler error

6 participants