-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Attributes starting with rustc_ are supposed to be gated, but they are not always gated #62116
Copy link
Copy link
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
Of course, the specific known built-in attributes like
#[rustc_copy_clone_marker]are feature gated, but therustc_*names are not reserved in general.As a result, you can easily create a procedural macro attribute starting with
rustc_.As a result, introduction of a new built-in attribute is technically a breaking change even if the attribute starts with
rustc_.Q: Why is introduction of a new built-in attribute a breaking change.
A: Because built-in attributes will conflict with any other attributes in scope having the same name (see #53913 (comment) for some technical details).
Possible solutions:
rustc_, including macros, run crater and see what happens.rustc_.rustc_*built-in attributes anyway and go through the same technically breaking changes in process.