Skip to content

Nonsensical macro_rules error message #18328

@alexchandel

Description

@alexchandel

Consider the following (malformed) macro definition:

#![feature(macro_rules)]

macro_rules! foo( (i: ident) => (
        i[0] = 7;
    );
)

fn main() {
    let mut i = vec!(0u, 1, 2, 3);
    foo!();
    println!("{}", i);
}

Compiling this fails with:

<anon>:1:1: 1:1 error: unexpected end of macro invocation
<anon>:1 #![feature(macro_rules)]
         ^

This isn't helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions