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-compilememIssue: Problems and improvements with respect to memory usage during compilation.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 issueT-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