Skip to content

Commit

Permalink
Merge pull request #351 from dtolnay/badraw
Browse files Browse the repository at this point in the history
Fix panic on parsing disallowed raw identifier in fallback mode
  • Loading branch information
dtolnay authored Sep 28, 2022
2 parents 8f4fd2c + 1eda96a commit 164a5fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/parse.rs
Original file line number Diff line number Diff line change
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 164a5fd

Please sign in to comment.