-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Description
Place a macro like panic!
or println!
outside of a function body:
panic!("outside of a function");
fn main() { }
The error message does not provide the expansion site:
<std macros>:2:1: 2:2 error: macro expansion ignores token `{` and any following
<std macros>:2 {
^
error: aborting due to previous error
A similar effect is had in an impl body.
struct Foo;
impl Foo{
panic!("in impl body");
}
fn main() {}
----------------------
<std macros>:2:1: 2:2 error: expected `fn`, found `{`
<std macros>:2 {
^
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)