Skip to content

End of macro invocation before expected produces EOF #27569

Closed
@Wilfred

Description

@Wilfred
fn main() {
    let message = "world";
    println!("Hello, {}", message/);
}

This gives the following compile error:



<anon>:3:34: 3:35 error: unexpected token: `<eof>`
<anon>:3     println!("Hello, {}", message/);
                                          ^

I think this is slightly misleading: it's not an EOF at the position where the caret is.

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, ..)A-parserArea: The lexing & parsing of Rust source code to an ASTC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions