-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.P-lowLow priorityLow priority
Description
Given the following
rust/src/test/ui/parser/inner-attr.rs
Lines 1 to 4 in dc6db14
#[feature(lang_items)] | |
#![recursion_limit="100"] //~ ERROR an inner attribute is not permitted following an outer attribute | |
fn main() {} |
we currently emit
rust/src/test/ui/parser/inner-attr.stderr
Lines 1 to 7 in dc6db14
error: an inner attribute is not permitted following an outer attribute | |
--> $DIR/inner-attr.rs:3:3 | |
| | |
LL | #![recursion_limit="100"] | |
| ^ | |
| | |
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them. |
We should emit at least the following
error: an inner attribute is not permitted following an outer attribute
--> $DIR/inner-attr.rs:3:3
|
LL | #[feature(lang_items)]
| ---------------------- previous outer attribute
LL |
LL | #![recursion_limit="100"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ not permited following an outer attibute
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
We might also want to provide suggestions when it makes sense (like turning the feature
attr into an outer attr).
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.P-lowLow priorityLow priority