about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-02-02 17:56:53 +0000
committerbors <bors@rust-lang.org>2023-02-02 17:56:53 +0000
commitf3126500f25114ba4e0ac3e76694dd45a22de56d (patch)
treeab016ef14231c6193f6a9d086fca0cda4a159f9a /compiler/rustc_parse/src/parser/expr.rs
parent97872b792c9dd6a9bc5c3f4e62a0bd5958b09cdc (diff)
parent08181eabfeb468e22e5ce179492979d57d0cdf85 (diff)
downloadrust-f3126500f25114ba4e0ac3e76694dd45a22de56d.tar.gz
rust-f3126500f25114ba4e0ac3e76694dd45a22de56d.zip
Auto merge of #107601 - matthiaskrgr:rollup-07zaafe, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #106919 (Recover `_` as `..` in field pattern)
 - #107493 (Improve diagnostic for missing space in range pattern)
 - #107515 (Improve pretty-printing of `HirIdValidator` errors)
 - #107524 (Remove both StorageLive and StorageDead in CopyProp.)
 - #107532 (Erase regions before doing uninhabited check in borrowck)
 - #107559 (Rename `rust_2015` → `is_rust_2015`)
 - #107577 (Reinstate the `hir-stats.rs` tests on stage 1.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index b7a023868fc..3d42a9dcbbe 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -2717,6 +2717,14 @@ impl<'a> Parser<'a> {
                     );
                     err.emit();
                     this.bump();
+                } else if matches!(
+                    (&this.prev_token.kind, &this.token.kind),
+                    (token::DotDotEq, token::Gt)
+                ) {
+                    // `error_inclusive_range_match_arrow` handles cases like `0..=> {}`,
+                    // so we supress the error here
+                    err.delay_as_bug();
+                    this.bump();
                 } else {
                     return Err(err);
                 }