rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97k stars 12.54k forks source link

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

Closed durka closed 7 years ago

durka commented 8 years ago

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 commented 7 years ago

I'm marking this fixed as per #31719