Skip to content

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

Closed
@durka

Description

@durka

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-parserArea: The lexing & parsing of Rust source code to an AST

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions