Do not parse underscore as Ident
Underscore never used to be parsed as Ident because rustc presented it
as an Op. When nightly changed to treating underscore as Term, Syn
retroactively began accepting it as an Ident which is incorrect.
diff --git a/src/ident.rs b/src/ident.rs
index c630625..620bfc7 100644
--- a/src/ident.rs
+++ b/src/ident.rs
@@ -254,8 +254,9 @@
return parse_error();
}
match term.as_str() {
+ "_"
// From https://doc.rust-lang.org/grammar.html#keywords
- "abstract" | "alignof" | "as" | "become" | "box" | "break" | "const"
+ | "abstract" | "alignof" | "as" | "become" | "box" | "break" | "const"
| "continue" | "crate" | "do" | "else" | "enum" | "extern" | "false" | "final"
| "fn" | "for" | "if" | "impl" | "in" | "let" | "loop" | "macro" | "match"
| "mod" | "move" | "mut" | "offsetof" | "override" | "priv" | "proc" | "pub"