about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2025-02-21 17:38:30 -0300
committerSantiago Pastorino <spastorino@gmail.com>2025-03-06 17:58:34 -0300
commit65d65e5e7eac02bfbb9f4053b7ec0db8f4c0f183 (patch)
treef9283d91594ae348a3ed8d6ecd35705df6c9977c /compiler/rustc_parse/src
parent4e6407ab947314480f3b978a20f9b0685ad59f78 (diff)
downloadrust-65d65e5e7eac02bfbb9f4053b7ec0db8f4c0f183.tar.gz
rust-65d65e5e7eac02bfbb9f4053b7ec0db8f4c0f183.zip
Parse and allow const use closures
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 7dabc28c645..4ec8d9e5e49 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -813,9 +813,9 @@ impl<'a> Parser<'a> {
         self.is_keyword_ahead(0, &[kw::Const])
             && self.look_ahead(1, |t| match &t.kind {
                 // async closures do not work with const closures, so we do not parse that here.
-                token::Ident(kw::Move | kw::Static, IdentIsRaw::No) | token::OrOr | token::Or => {
-                    true
-                }
+                token::Ident(kw::Move | kw::Use | kw::Static, IdentIsRaw::No)
+                | token::OrOr
+                | token::Or => true,
                 _ => false,
             })
     }