about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/stmt.rs
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2023-01-19 10:24:17 +0100
committerest31 <MTest31@outlook.com>2023-05-05 21:44:13 +0200
commit59ecbd2cea20839f1288b917cbf5ba8c23864df7 (patch)
treec60e269ea5a5df36aa47f2f7ee400d859376c475 /compiler/rustc_parse/src/parser/stmt.rs
parent4b94c232192b0fa0314b5afa18e366356e210c4c (diff)
downloadrust-59ecbd2cea20839f1288b917cbf5ba8c23864df7.tar.gz
rust-59ecbd2cea20839f1288b917cbf5ba8c23864df7.zip
Add parsing for builtin # in expression and item context
Diffstat (limited to 'compiler/rustc_parse/src/parser/stmt.rs')
-rw-r--r--compiler/rustc_parse/src/parser/stmt.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs
index 1c17de337e8..a0bd086053e 100644
--- a/compiler/rustc_parse/src/parser/stmt.rs
+++ b/compiler/rustc_parse/src/parser/stmt.rs
@@ -90,7 +90,11 @@ impl<'a> Parser<'a> {
                 attrs,
                 errors::InvalidVariableDeclarationSub::UseLetNotVar,
             )?
-        } else if self.check_path() && !self.token.is_qpath_start() && !self.is_path_start_item() {
+        } else if self.check_path()
+            && !self.token.is_qpath_start()
+            && !self.is_path_start_item()
+            && !self.is_builtin()
+        {
             // We have avoided contextual keywords like `union`, items with `crate` visibility,
             // or `auto trait` items. We aim to parse an arbitrary path `a::b` but not something
             // that starts like a path (1 token), but it fact not a path.