Skip to content

Commit

Permalink
Fix panic on parsing disallowed raw identifier in fallback mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 28, 2022
1 parent 8f4fd2c commit 1eda96a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/parse.rs
Expand Up @@ -283,8 +283,9 @@ fn ident_any(input: Cursor) -> PResult<crate::Ident> {
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());
Expand Down

0 comments on commit 1eda96a

Please sign in to comment.