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

Fails to parse attributes on enum variants #2

Closed
andersk opened this issue Apr 8, 2015 · 3 comments
Closed

Fails to parse attributes on enum variants #2

andersk opened this issue Apr 8, 2015 · 3 comments

Comments

@andersk
Copy link
Owner

andersk commented Apr 8, 2015

Due to rust-lang/rust#24189, we can’t match attributes on enum variants:

#[macro_use] extern crate enum_primitive;

enum_from_primitive! {
enum FooBar {
    Foo = 17,
    #[doc = "bar"]
    Bar = 42,
}
}
r.rs:6:5: 6:6 error: local ambiguity: multiple parsing options: built-in NTs ident ('variant') or 1 other options.
r.rs:6     #[doc = "bar"]
           ^
@nwin
Copy link

nwin commented Apr 29, 2015

Same happens for simple doc comments

#[macro_use] extern crate enum_primitive;

enum_from_primitive! {
enum FooBar {
    Foo = 17,
    /// bar
    Bar = 42,
}
}

@beamspease
Copy link

I too am running into the same problem as nwin

@andersk
Copy link
Owner Author

andersk commented Nov 15, 2017

This was fixed in Rust 1.20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants