Fails to parse attributes on enum variants
andersk opened this issue · comments
Anders Kaseorg commented
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 commented
Same happens for simple doc comments
#[macro_use] extern crate enum_primitive;
enum_from_primitive! {
enum FooBar {
Foo = 17,
/// bar
Bar = 42,
}
}
beamspease commented
I too am running into the same problem as nwin
Anders Kaseorg commented
This was fixed in Rust 1.20.