Skip to content

Commit

Permalink
Restore compatibility with rustc older than 1.33
Browse files Browse the repository at this point in the history
    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 | |         }
        | |_________^
  • Loading branch information
dtolnay committed Jun 20, 2022
1 parent e04304f commit 868a8ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/fallback.rs
Expand Up @@ -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);
}
_ => {}
}
}
}
Expand Down

0 comments on commit 868a8ea

Please sign in to comment.