about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/util/parser.rs
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2022-11-16 18:36:17 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-06-19 12:54:34 +0000
commitd7713feb99d45fb0c8122118c2c29008358e363d (patch)
treec2e986a8fd58f075e3008fc3fdf6e855ead8750c /compiler/rustc_ast/src/util/parser.rs
parent8d1fa473dddd12efb2430302e5f5dfcc3eb73f8b (diff)
downloadrust-d7713feb99d45fb0c8122118c2c29008358e363d.tar.gz
rust-d7713feb99d45fb0c8122118c2c29008358e363d.zip
Syntatically accept `become` expressions
Diffstat (limited to 'compiler/rustc_ast/src/util/parser.rs')
-rw-r--r--compiler/rustc_ast/src/util/parser.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_ast/src/util/parser.rs b/compiler/rustc_ast/src/util/parser.rs
index 35afd542372..096077e09bf 100644
--- a/compiler/rustc_ast/src/util/parser.rs
+++ b/compiler/rustc_ast/src/util/parser.rs
@@ -245,6 +245,7 @@ pub enum ExprPrecedence {
     Ret,
     Yield,
     Yeet,
+    Become,
 
     Range,
 
@@ -298,7 +299,8 @@ impl ExprPrecedence {
             | ExprPrecedence::Continue
             | ExprPrecedence::Ret
             | ExprPrecedence::Yield
-            | ExprPrecedence::Yeet => PREC_JUMP,
+            | ExprPrecedence::Yeet
+            | ExprPrecedence::Become => PREC_JUMP,
 
             // `Range` claims to have higher precedence than `Assign`, but `x .. x = x` fails to
             // parse, instead of parsing as `(x .. x) = x`. Giving `Range` a lower precedence