From 4be2a86fce293c9c15ccab6348ebec272aa8c31d Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 19 Jun 2022 18:12:55 -0700 Subject: [PATCH] Delete unreachable cases from raw identifier check "" 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`. --- src/fallback.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fallback.rs b/src/fallback.rs index 570007cb..6b7837e8 100644 --- a/src/fallback.rs +++ b/src/fallback.rs @@ -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); } _ => {}