You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't spin expanding stmt macros.
If we can't make progress when parsing a macro expansion as a statement then we should just bail.
This alleviates the symptoms shown in e.g. #37113 and #37234 but it doesn't fix the problem that parsing invalid enum bodies (and others) leaves the parser in a crappy state.
I'm not sold on this strategy (checking `tokens_consumed`), so if anyone has a better idea, I'm all ears!
error: expected one of `.`, `;`, `?`, or an operator, found `""`
--> test.rs:3:19
|
3 | let x = 5 "";
| -^^ unexpected token
| |
| expected one of `.`, `;`, `?`, or an operator here
error: macro expansion ignores token `}` and any following
--> test.rs:4:5
|
4 | }}
| ^
|
note: caused by the macro expansion here; the usage of `failed!` is likely invalid in statement context
--> test.rs:8:5
|
8 | failed!();
| ^^^^^^^^^^
error: aborting due to 2 previous errors
rustc successfully detects error, but then never returns and starts eating memory
Version info:
I'm using version from Debian (unstable) repository.
The text was updated successfully, but these errors were encountered: