Proposal
Make a naming convention such that all all rustc_ attributes that are used only for lint/diagnostic purposes are clearly distinguished from all other rustc_ attributes hich might have semantic implications.
This will make it clear that the lint/diagnostic-only attributes do not affect semantics and are not (as) important.
Personal anecdote
I was just reading sources of UnsafeCell and saw #[rustc_as_ptr] and #[rustc_never_returns_null_ptr] and had a minor heart attack thinking #[rustc_never_returns_null_ptr] changes the LLVM ir to exclude 0 from the valid range of the return (similarly to something I just removed some months ago: rust-lang/rust#154327).
However, it looks like both of these attributes are only used for lints.
Alternative
Add a #[rustc_diagnostic_item_group(...)] similarly to #[rustc_diagnostic_item], but allowing multiple items to have the same "diagnostic group", such that we have a unified way for lints to special-case certain item groups.
Mentors or Reviewers
If you have a reviewer or mentor in mind for this work, mention them here. You can put your own name here if you are planning to mentor the work.
Process
The main points of the Major Change Process are as follows:
You can read more about Major Change Proposals on forge.
Proposal
Make a naming convention such that all all
rustc_attributes that are used only for lint/diagnostic purposes are clearly distinguished from all otherrustc_attributes hich might have semantic implications.This will make it clear that the lint/diagnostic-only attributes do not affect semantics and are not (as) important.
Personal anecdote
I was just reading sources of
UnsafeCelland saw#[rustc_as_ptr]and#[rustc_never_returns_null_ptr]and had a minor heart attack thinking#[rustc_never_returns_null_ptr]changes the LLVM ir to exclude0from the valid range of the return (similarly to something I just removed some months ago: rust-lang/rust#154327).However, it looks like both of these attributes are only used for lints.
Alternative
Add a
#[rustc_diagnostic_item_group(...)]similarly to#[rustc_diagnostic_item], but allowing multiple items to have the same "diagnostic group", such that we have a unified way for lints to special-case certain item groups.Mentors or Reviewers
If you have a reviewer or mentor in mind for this work, mention them here. You can put your own name here if you are planning to mentor the work.
Process
The main points of the Major Change Process are as follows:
@rustbot secondor kickoff a team FCP with@rfcbot fcp $RESOLUTION.You can read more about Major Change Proposals on forge.