about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-05-28 17:32:45 +0000
committerbors <bors@rust-lang.org>2025-05-28 17:32:45 +0000
commit6f69710780d579b180ab38da4c1384d630f7bd31 (patch)
treecd6faf47da2cb40738c104cac3c4765c1e1ffa0c /compiler/rustc_parse/src/parser
parent40311c4dcf666e8bddcec4a8059e7d9f12bbd363 (diff)
parentd6b1108cdae286fb680f310bc5929924bdf25965 (diff)
downloadrust-6f69710780d579b180ab38da4c1384d630f7bd31.tar.gz
rust-6f69710780d579b180ab38da4c1384d630f7bd31.zip
Auto merge of #141696 - tgross35:rollup-fhpj180, r=tgross35
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#140369 (Add data_ptr method to Mutex and RwLock)
 - rust-lang/rust#140697 (Split `autodiff` into `autodiff_forward` and `autodiff_reverse`)
 - rust-lang/rust#141404 (Improve intrinsic handling in cg_ssa)
 - rust-lang/rust#141411 (rustdoc: linking to a local proc macro no longer warns)
 - rust-lang/rust#141548 (consider glob imports in cfg suggestion)
 - rust-lang/rust#141627 (Drop-build cleanups)
 - rust-lang/rust#141670 (Fix ICE in tokenstream with contracts from parser recovery)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/stmt.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs
index 396ded96bde..ccc3410674b 100644
--- a/compiler/rustc_parse/src/parser/stmt.rs
+++ b/compiler/rustc_parse/src/parser/stmt.rs
@@ -515,8 +515,8 @@ impl<'a> Parser<'a> {
     fn error_block_no_opening_brace_msg(&mut self, msg: Cow<'static, str>) -> Diag<'a> {
         let prev = self.prev_token.span;
         let sp = self.token.span;
-        let mut e = self.dcx().struct_span_err(sp, msg);
-        self.label_expected_raw_ref(&mut e);
+        let mut err = self.dcx().struct_span_err(sp, msg);
+        self.label_expected_raw_ref(&mut err);
 
         let do_not_suggest_help = self.token.is_keyword(kw::In)
             || self.token == token::Colon
@@ -558,20 +558,19 @@ impl<'a> Parser<'a> {
                     stmt.span
                 };
                 self.suggest_fixes_misparsed_for_loop_head(
-                    &mut e,
+                    &mut err,
                     prev.between(sp),
                     stmt_span,
                     &stmt.kind,
                 );
             }
             Err(e) => {
-                self.recover_stmt_(SemiColonMode::Break, BlockMode::Ignore);
-                e.cancel();
+                e.delay_as_bug();
             }
             _ => {}
         }
-        e.span_label(sp, "expected `{`");
-        e
+        err.span_label(sp, "expected `{`");
+        err
     }
 
     fn suggest_fixes_misparsed_for_loop_head(