Closed
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 {
^