Skip to content

ICE: with macros #5060

Closed
Closed
@brendanzab

Description

@brendanzab

Sorry, couldn't think of a better name for this issue.

macro_rules! print_hd_tl (
    ($field_hd:ident, $($field_tl:ident),+) => ({
        io::print(stringify!($field));
        io::print("::[");
        $(
            io::print(stringify!($field_tl));
            io::print(", ");
        )+
        io::print("]\n");
    })
)

fn main() {
    print_hd_tl!(x, y, z, w)
}

Expected

x::[y, z, w]

Error

$ RUST_LOG=rustc=1,::rt::backtrace rustc print-hd-tl-ice.rs
rust: task failed at 'Key not found in table: &{repr: 44}', /usr/local/src/rust/src/libstd/oldmap.rs:322
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /usr/local/src/rust/src/librustc/rustc.rc:365
rust: domain main @0x7f838a80c210 root task failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensionsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions