Skip to content

Commit

Permalink
Delete unreachable cases from raw identifier check
Browse files Browse the repository at this point in the history
"" is ruled out by the check for `if string.is_empty()` at the top.
"$crate" and "{{root}}" are ruled out because their first character does
not pass `is_ident_start`.
  • Loading branch information
dtolnay committed Jun 20, 2022
1 parent d918477 commit 4be2a86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fallback.rs
Expand Up @@ -701,7 +701,7 @@ fn validate_ident(string: &str, raw: bool) {

if raw {
match string {
"" | "_" | "super" | "self" | "Self" | "crate" | "$crate" | "{{root}}" => {
"_" | "super" | "self" | "Self" | "crate" => {
panic!("`{}` cannot be a raw identifier", string);
}
_ => {}
Expand Down

0 comments on commit 4be2a86

Please sign in to comment.