commit | 7926839cb8e9fdcc05eaa3028cedc761bc50ea2d | [log] [tgz] |
---|---|---|
author | David Tolnay <dtolnay@gmail.com> | Sat Oct 13 19:55:48 2018 -0700 |
committer | David Tolnay <dtolnay@gmail.com> | Sat Oct 13 19:55:48 2018 -0700 |
tree | 3c83660a60315434f2260fbfc24313a7b8a424c8 | |
parent | f1a1026336753a0e88af163c928b90ff2f70a1c7 [diff] |
Allow true/false as the name in a MetaNameValue
diff --git a/src/attr.rs b/src/attr.rs index a07fa77..449e76e 100644 --- a/src/attr.rs +++ b/src/attr.rs
@@ -618,7 +618,7 @@ fn parse(input: ParseStream) -> Result<Self> { let ahead = input.fork(); - if ahead.peek(Lit) { + if ahead.peek(Lit) && !(ahead.peek(LitBool) && ahead.peek2(Token![=])) { input.parse().map(NestedMeta::Literal) } else if ahead.call(Ident::parse_any).is_ok() { input.parse().map(NestedMeta::Meta)