diff --git a/src/parse.rs b/src/parse.rs index 1c9974cf..d2b86a41 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -283,8 +283,9 @@ fn ident_any(input: Cursor) -> PResult { return Ok((rest, ident)); } - if sym == "_" { - return Err(Reject); + match sym { + "_" | "super" | "self" | "Self" | "crate" => return Err(Reject), + _ => {} } let ident = crate::Ident::_new_raw(sym, crate::Span::call_site());