Skip to content

Compiler crashes on malformed macro #23389

Closed
@Binero

Description

@Binero

A simple malformed macro makes the compiler crash.

Code:

macro_rules! code_block {
    $c:block => $c
}

Playpen error:

<anon>:1:1: 3:2 error: internal compiler error: wrong-structured lhs for follow check (didn't find a TtDelimited or TtSequence)
<anon>:1 macro_rules! code_block {
<anon>:2     $c:block => $c
<anon>:3 }
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:130

Playpen: http://is.gd/COoZe7

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions