Skip to content

Macro with empty expansion in expression position causes an "unexpected <eof>" error #10951

Closed
@huonw

Description

@huonw
macro_rules! foo ( () => () );
fn main() { foo!() }
expand.rs:1:0: 1:0 error: unexpected token: `<eof>`
expand.rs:1 macro_rules! foo ( () => () );
            ^

(Moving the foo!() outside main works.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-syntaxextArea: Syntax extensionsC-enhancementCategory: An issue proposing an enhancement or a PR with one.P-lowLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions