Skip to content

Compiler hangs and eats memory on malformed macro extension #37234

Closed
@caryoscelus

Description

@caryoscelus
macro_rules! failed {
    () => {{
        let x = 5 "";
    }}
}

fn main() {
    failed!();
//    let x = 5 ""; //fails normally
}

rustc successfully detects error, but then never returns and starts eating memory

error: expected one of `.`, `;`, `?`, or an operator, found `""`
 --> fail.rs:3:19
  |
3 |         let x = 5 "";
  |                   ^^

Version info:

rustc 1.12.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.12.0

I'm using version from Debian (unstable) repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions