Reject outer attributes on cfg_select branches#155734
Reject outer attributes on cfg_select branches#155734qaijuang wants to merge 3 commits intorust-lang:mainfrom
cfg_select branches#155734Conversation
fb8cf2e to
9c49112
Compare
Co-authored-by: Copilot <copilot@github.com>
|
Some changes occurred in compiler/rustc_attr_parsing |
|
rustbot has assigned @JonathanBrouwer. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Reminder, once the PR becomes ready for a review, use |
|
@bors r+ rollup |
…=JonathanBrouwer Lint doc comments in cfg_select branches Fixes rust-lang#155701.
…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)
|
This PR allows more code to compile, so it's a language change and technically needs a T-lang FCP. cc @rust-lang/lang |
|
I'm sorry @bors r- |
|
This pull request was unapproved. This PR was contained in a rollup (#155773), which was unapproved. |
There was a problem hiding this comment.
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.
Right I missed that, I'm so sorry |
The fact that this was stabilized recently doesn't imply that the feature is malleable at will. The grammar of I would say it's very much not in the spirit to assume that certain extensions are 'natural' and implicitly follow from a past FCP that has since completed since that would defeat the whole purpose of (exhaustive) stabilization reports and it would circumnavigate the entire stabilization process. More concretely, regarding the change at hand, I would state that is doesn't make any sense to allow outer doc comments (a special kind of outer attribute) without also allowing regular outer attributes, that's unprecedented. Now, allowing regular outer attributes comes with various non-trivial questions like which attributes should be allowed ( |
|
Indeed, the language design question is not trivial here. |
Thanks @fmease for catching this and navigating it. |
cfg_select branches
|
The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease |
View all comments
Fixes #155701.