Skip to content

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

Closed

Description

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions