Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local ambiguity in macro *definition* #28084

Open
jonas-schievink opened this Issue Aug 29, 2015 · 5 comments

Comments

Projects
None yet
7 participants
@jonas-schievink
Copy link
Member

jonas-schievink commented Aug 29, 2015

macro_rules! m {
    () => ();;
}
<anon>:2:14: 2:15 error: local ambiguity: multiple parsing options: built-in NTs tt ('lhs') or 1 other options.
<anon>:2     () => ();;
                      ^

(the equivalent of $( $lhs:tt => $rhs:tt );+ $(;)* is used to parse macros)

This leaks "lhs", which is an implementation detail, and is a bad error message.

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jun 1, 2017

Still repros.

@brson brson added P-low T-lang I-wrong and removed I-wrong labels Jun 1, 2017

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jun 1, 2017

Bad error message.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jun 1, 2017

Seems to me to be primarily a bad error message -- it's not clear we should accept trailing ; (we don't accept trailing separators in any other context?)

@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Oct 15, 2018

Triage: still happens:

error: local ambiguity: multiple parsing options: built-in NTs tt ('lhs') or 1 other option.
 --> src/lib.rs:2:14
  |
2 |     () => ();;
  |              ^

error: aborting due to previous error
@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Feb 18, 2019

Triage: same behavior now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.