-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
error message for macro in wrong context is missing context #34421
Comments
cc me |
So this fell through the cracks, and was a stable to nightly/beta regression. It still is a regression, in a way, but only of diagnostics. @jseyfried Could you take a look? |
Nominating for prioritization. |
So this part of the (previous) stable message:
feels like a bug to me anyhow. This part:
is sort of good. It'd be nice to preserve a backtrace, at least. And ideally we'd suggest adding a |
Given how much time has past, we're going to call this P-medium for now. However, @jseyfried will try to write up some mentoring instructions (or maybe fix it). He has a plan. =) triage: P-medium |
I think the best path forward here is to try parsing an expression macro expansion as a statement before emitting an error. If the macro expansion parses as a statement successfully, we can emit a more helpful error suggesting that the user add a semicolon to the macro invocation. |
I'm interested in this but I need informations to understand what to do :) |
Current output:
|
Diagnostics meeting triage: lowering priority as the current error is pretty good, even if not ideal yet. |
Current output:
(Notice that we recover -- it's not a fatal error now.) |
suggest `;` on expr `mac!()` which is good as stmt `mac!()` Fixes rust-lang#34421 by implementing @jseyfried's suggestion in rust-lang#34421 (comment). r? @petrochenkov
This is a regression from stable to beta and nightly.
This code is wrong (missing semicolons):
Stable prints:
Beta and nightly both print:
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.cc @nikomatsakis @jonathandturner
The text was updated successfully, but these errors were encountered: