Unreserve former keywords: pure, offsetof, sizeof, alignof
diff --git a/src/synom.rs b/src/synom.rs
index e452f92..2b0538d 100644
--- a/src/synom.rs
+++ b/src/synom.rs
@@ -251,17 +251,18 @@
_ => return parse_error(),
};
match &ident.to_string()[..] {
- "_"
- // From https://doc.rust-lang.org/grammar.html#keywords
- | "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"
- | "pure" | "ref" | "return" | "Self" | "self" | "sizeof" | "static" | "struct"
- | "super" | "trait" | "true" | "type" | "typeof" | "unsafe" | "unsized" | "use"
- | "virtual" | "where" | "while" | "yield" => return parse_error(),
- _ => {}
- }
+ "_"
+ // Based on https://doc.rust-lang.org/grammar.html#keywords
+ // and https://github.com/rust-lang/rfcs/blob/master/text/2421-unreservations-2018.md
+ | "abstract" | "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" | "override" | "priv" | "proc" | "pub"
+ | "ref" | "return" | "Self" | "self" | "static" | "struct"
+ | "super" | "trait" | "true" | "type" | "typeof" | "unsafe" | "unsized" | "use"
+ | "virtual" | "where" | "while" | "yield" => return parse_error(),
+ _ => {}
+ }
Ok((ident, rest))
}
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index cc2a810..2e5485a 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -112,10 +112,6 @@
//
// https://github.com/dtolnay/syn/issues/455
"tests/rust/src/test/run-pass/label_break_value.rs" |
- // TODO unreserve pure, offsetof, sizeof, alignof
- //
- // https://github.com/dtolnay/syn/issues/454
- "tests/rust/src/test/run-pass/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs" |
// Deprecated placement syntax
"tests/rust/src/test/run-pass/new-box-syntax.rs" |
"tests/rust/src/test/ui/obsolete-in-place/bad.rs" |