From 868a8ea2d94a705e709dc77a6803cee05ed3d5e4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 19 Jun 2022 18:08:19 -0700 Subject: [PATCH] Restore compatibility with rustc older than 1.33 error[E0658]: multiple patterns in `if let` and `while let` are unstable (see issue #48215) --> src/fallback.rs:704:9 | 704 | / if let "" | "_" | "super" | "self" | "Self" | "crate" | "$crate" | "{{root}}" = string { 705 | | panic!("`{}` cannot be a raw identifier", string); 706 | | } | |_________^ --- src/fallback.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/fallback.rs b/src/fallback.rs index 8567a13b..fecc9b3e 100644 --- a/src/fallback.rs +++ b/src/fallback.rs @@ -701,8 +701,11 @@ fn validate_ident(string: &str, raw: bool) { } if raw { - if let "" | "_" | "super" | "self" | "Self" | "crate" | "$crate" | "{{root}}" = string { - panic!("`{}` cannot be a raw identifier", string); + match string { + "" | "_" | "super" | "self" | "Self" | "crate" | "$crate" | "{{root}}" => { + panic!("`{}` cannot be a raw identifier", string); + } + _ => {} } } }