Skip to content

ICE non-eager expansion without a parent scope #66804

Closed
@GuillaumeGomez

Description

@GuillaumeGomez

When running the following code, the compiler crashes. This bug is reproducible is nightly, beta and stable:

macro_rules! doc_comment {
    ($x:expr) => {
        #[doc = $x]
        extern {}
    };
}

macro_rules! some_macro {
    ($t1: ty) => {
        doc_comment!{format!("{coor}", coor = stringify!($t1)).as_str()}}
}

fn main() {
    some_macro!(u8);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions