auto merge of #18766 : liigo/rust/improve-inner-attr-msg, r=huonw
for the code: ``` use std::io; #![crate_type="rlib"] // ERROR: an inner attribute is not permitted in this context fn say_hello() { println!("hello"); } ``` this PR provides another note to help programmer fixing this error more easily: ``` hello.rs:6:3: 6:4 error: an inner attribute is not permitted in this context hello.rs:6 #![crate_type="rlib"] ^ hello.rs:6:3: 6:4 note: put inner attribute in top of file or block hello.rs:6 #![crate_type="rlib"] ^ ```
This commit is contained in:
commit
66c3c8e3e6
@ -75,6 +75,8 @@ impl<'a> ParserAttr for Parser<'a> {
|
||||
self.span_err(span,
|
||||
"an inner attribute is not permitted in \
|
||||
this context");
|
||||
self.span_help(span,
|
||||
"place inner attribute at the top of the module or block");
|
||||
}
|
||||
ast::AttrInner
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user