Skip to content

Nonsensical macro_rules error message #18328

Closed
@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.

Activity

huonw

huonw commented on Oct 26, 2014

@huonw
Member

Dupe of #7970.

added a commit that references this issue on Oct 22, 2024

Auto merge of rust-lang#18328 - Veykril:veykril/push-zrzmmyqzqwyr, r=…

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alexchandel@huonw

        Issue actions

          Nonsensical macro_rules error message · Issue #18328 · rust-lang/rust