Skip to content

Confusing error message on incorrect macro invocation #10106

Closed
@kmcallister

Description

@kmcallister
#[feature(macro_rules)];

macro_rules! mymacro(
    ($x:ident) => ( "foo" );
)

fn main() {
    println(mymacro!());
}
$ rustc --version
rustc 0.9-pre (a7453ad 2013-10-22 15:31:26 -0700)
host: x86_64-unknown-linux-gnu

$ rustc foo.rs
foo.rs:1:0: 1:0 error: Unexpected end of macro invocation
foo.rs:1 #[feature(macro_rules)];
         ^

The error is the missing argument to the mymacro!() invocation. The error caret should point there, not to the first line in the crate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions