Closed
Description
This is a regression from stable to beta and nightly.
This code is wrong (missing semicolons):
macro_rules! make_item {
($a:ident) => { struct $a; }
}
fn a() { make_item!(A) }
fn b() { make_item!(B) }
Stable prints:
<anon>:2:21: 2:27 error: expected identifier, found keyword `struct`
<anon>:2 ($a:ident) => { struct $a; }
^~~~~~
<anon>:5:21: 5:22 error: macro expansion ignores token `A` and any following
<anon>:5 fn a() { make_item!(A) }
^
<anon>:5:10: 5:23 note: caused by the macro expansion here; the usage of `make_item!` is likely invalid in expression context
<anon>:5 fn a() { make_item!(A) }
^~~~~~~~~~~~~
<anon>:2:21: 2:27 error: expected identifier, found keyword `struct`
<anon>:2 ($a:ident) => { struct $a; }
^~~~~~
<anon>:6:21: 6:22 error: macro expansion ignores token `B` and any following
<anon>:6 fn b() { make_item!(B) }
^
<anon>:6:10: 6:23 note: caused by the macro expansion here; the usage of `make_item!` is likely invalid in expression context
<anon>:6 fn b() { make_item!(B) }
^~~~~~~~~~~~~
error: aborting due to 4 previous errors
Beta and nightly both print:
error: expected expression, found keyword `struct`
--> <anon>:2:21
|>
2 |> ($a:ident) => { struct $a; }
|> ^^^^^^
Notice that not only is all the useful information gone, but the compiler aborts after the first error instead of finding the rest. It does not matter whether RUST_NEW_ERROR_FORMAT
is on or off.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsCategory: This is a bug.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Low priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.