Lint items after statements in macro expansions
The items_after_statements lint was skipping all expansions. Instead we should still lint local macros. Fixes #578
This commit is contained in:
parent
0cba5e6bd3
commit
32e2021b75
3 changed files with 22 additions and 5 deletions
|
|
@ -28,7 +28,10 @@ fn mac() {
|
|||
// do not lint this, because it needs to be after `a`
|
||||
macro_rules! b {
|
||||
() => {{
|
||||
a = 6
|
||||
a = 6;
|
||||
fn say_something() {
|
||||
println!("something");
|
||||
}
|
||||
}};
|
||||
}
|
||||
b!();
|
||||
|
|
|
|||
|
|
@ -16,5 +16,18 @@ LL | | println!("foo");
|
|||
LL | | }
|
||||
| |_____^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error: adding items after statements is confusing, since items exist from the start of the scope
|
||||
--> $DIR/item_after_statement.rs:32:13
|
||||
|
|
||||
LL | / fn say_something() {
|
||||
LL | | println!("something");
|
||||
LL | | }
|
||||
| |_____________^
|
||||
...
|
||||
LL | b!();
|
||||
| ----- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue