Skip to content

Infinite recursion in macro expansion crashes rustc #17628

Closed
@uwap

Description

@uwap

Defining macros recursively like so

macro_rules! recursive(
  () => (
    recursive!()
  )
)

fn main() {
  recursive!()
}

will lead rustc to cause a stack overflow.
It would be useful to improve the error message for that problem.
There is currently no error message specified for that issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions