-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors inside a macro invocation don't report the full location of the error #5794
Comments
Nominating for production-ready |
Triage visit: still valid, but this isn't at all specific to macro_rules! my_fmt {
($s:expr, $($e:expr),*) => {
fmt!($s, $($e),*)
}
}
fn main() {
let a = ~"";
my_fmt!("foo: %s %s", a);
}
It's hard to see how this would be resolved in general, since some of the time the errors will be caused by something internal to the macro (e.g. macro_rules! my_fmt {
($s:expr, $($e:expr),*) => {
fmt!($s, $($e),*) // error: not enough arguments to fmt! ...
}
}
fn main() {
let a = ~"";
my_fmt!("foo: %s %s", a); // note: macro invoked here
} |
accepted for production-ready milestone |
@jbclements, you were working in macros recently, do you have any idea what this would entail to fix? Right now @huonw and I are thinking that this should block #9153 because the error spans are so terrible. |
duplicating comment from IRC, I think it might help a lot just to include the arguments to the macro that failed. |
…, r=blyxyas Extend `NONMINIMAL_BOOL` lint Fixes rust-lang#5794. r? `@blyxyas` changelog: Extend `NONMINIMAL_BOOL` lint
It seems the
debug!
code isn't properly pushing a span onto the macro expansion span stack. This code:Only reports the error inside the macro, but not where that macro is getting used:
The text was updated successfully, but these errors were encountered: