Skip to content

Macro Expansion Hangs/OOMs #146767

@levinwinter

Description

@levinwinter
macro_rules! m {
    [ $( $( ),+ )* ] => {}
}

m! {}

The above code hangs and quickly exhausts memory. This happens on nightly and dates back all the way back to version 1.0.0.

You can safely run the code on the playground here.

This bug was found using fuzzing.

@rustbot label +C-bug +A-macros +I-hang +S-has-mcve

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-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueneeds-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions