-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Open
Open
Copy link
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-lack-of-suggestionDiagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.Diagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.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.
Description
#![rustc_main]
mod test {
}
Current output
error: `#[rustc_main]` attribute cannot be used on crates
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:12:1
|
LL | #![rustc_main]
| ^^^^^^^^^^^^^^
|
= help: `#[rustc_main]` can only be applied to functions
Desired output
error: `#[rustc_main]` attribute cannot be used on crates
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:12:1
|
LL | #![rustc_main]
| ^^^^^^^^^^^^^^
|
= help: `#[rustc_main]` can only be applied to functions. perhaps you meant to use an outer attribute
|
LL - #![rustc_main]
LL + #[rustc_main]
This hint was there before the target checking refactor but not after, and I think it is a nice hint for people who are a little confused about the attribute syntax of rust and accidentally used !
.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-lack-of-suggestionDiagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.Diagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.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.