about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-11-20 07:16:55 +0000
committerGitHub <noreply@github.com>2024-11-20 07:16:55 +0000
commit8d3d69434945684d1b260ff8476f6e242ad177d4 (patch)
treedb6b8e13f9ca4133bfb97e89d2d2760ef8dc5e7a /compiler/rustc_parse/src/parser
parent4520ff84e151a8eb904146cdd19353a92b671ba8 (diff)
parent13dbc8443e0cd254ee08138b60afd4abf1be2d33 (diff)
downloadrust-8d3d69434945684d1b260ff8476f6e242ad177d4.tar.gz
rust-8d3d69434945684d1b260ff8476f6e242ad177d4.zip
Merge pull request #4041 from rust-lang/rustup-2024-11-20
Automatic Rustup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 50a8b6542df..042ee96bbe8 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -641,9 +641,10 @@ impl<'a> Parser<'a> {
             return true;
         }
 
+        // Do an ASCII case-insensitive match, because all keywords are ASCII.
         if case == Case::Insensitive
             && let Some((ident, IdentIsRaw::No)) = self.token.ident()
-            && ident.as_str().to_lowercase() == kw.as_str().to_lowercase()
+            && ident.as_str().eq_ignore_ascii_case(kw.as_str())
         {
             true
         } else {