Skip to content
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

unprintable span with nested macro call and shadowed loop label #31719

Closed
durka opened this issue Feb 17, 2016 · 1 comment
Closed

unprintable span with nested macro call and shadowed loop label #31719

durka opened this issue Feb 17, 2016 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-parser Area: The parsing of Rust source code to an AST

Comments

@durka
Copy link
Contributor

durka commented Feb 17, 2016

This code:

macro_rules! as_expr {
    ($e:expr) => { $e }
}

macro_rules! make_loops {
    ($($life:tt)*) => {
        $(as_expr!($life: loop { break; }))*
    }
}

fn main() {
    make_loops!('a 'a);
}

triggers a warning about the shadowed label name, but it does not manage to print out either of the two spans:

<anon>:12:20: 7:42 warning: label name `'a` shadows a label name that is already in scope
(internal compiler error: unprintable span)
<anon>:12:17: 7:42 note: shadowed label `'a` declared here
(internal compiler error: unprintable span)

(It says it's an ICE but compilation continues. So... it's a slush?) This occurs on stable/beta/nightly.

@durka durka changed the title unprintable span with nested macro and shadowed loop label unprintable span with recursive macro and shadowed loop label Feb 17, 2016
@durka durka changed the title unprintable span with recursive macro and shadowed loop label unprintable span with nested macro call and shadowed loop label Feb 17, 2016
@nagisa nagisa added A-parser Area: The parsing of Rust source code to an AST A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) labels Feb 17, 2016
birkenfeld added a commit to birkenfeld/rust that referenced this issue May 24, 2016
This makes the "shadowing labels" warning *not* print the entire loop
as a span, but only the lifetime.

Also makes rust-lang#31719 go away, but does not fix its root cause (the span
of the expanded loop is still wonky, but not used anymore).
Manishearth added a commit to Manishearth/rust that referenced this issue May 26, 2016
…elix

 This makes the \"shadowing labels\" warning *not* print the entire loop as a span, but only the lifetime.

Also makes rust-lang#31719 go away, but does not fix its root cause (the span of the expanded loop is still wonky, but not used anymore).
Manishearth added a commit to Manishearth/rust that referenced this issue May 27, 2016
…elix

 This makes the \"shadowing labels\" warning *not* print the entire loop as a span, but only the lifetime.

Also makes rust-lang#31719 go away, but does not fix its root cause (the span of the expanded loop is still wonky, but not used anymore).
@durka
Copy link
Contributor Author

durka commented Jan 7, 2017

I'm marking this fixed as per #31719

@durka durka closed this as completed Jan 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-parser Area: The parsing of Rust source code to an AST
Projects
None yet
Development

No branches or pull requests

2 participants