about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-17 01:23:40 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-21 10:20:05 +1100
commit010f3944e0f0baac8d738da49772fd06acd3701b (patch)
tree61076ee1ac994c4168075026c86130620c4d850c /compiler/rustc_mir_transform/src
parentbb594538fc6e84213a6b8d5e165442570aa48923 (diff)
downloadrust-010f3944e0f0baac8d738da49772fd06acd3701b.tar.gz
rust-010f3944e0f0baac8d738da49772fd06acd3701b.zip
Convert `delayed_bug`s to `bug`s.
I have a suspicion that quite a few delayed bug paths are impossible to
reach, so I did an experiment.

I converted every `delayed_bug` to a `bug`, ran the full test suite,
then converted back every `bug` that was hit. A surprising number were
never hit.

The next commit will convert some more back, based on human judgment.
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/coroutine.rs6
-rw-r--r--compiler/rustc_mir_transform/src/elaborate_drops.rs2
2 files changed, 2 insertions, 6 deletions
diff --git a/compiler/rustc_mir_transform/src/coroutine.rs b/compiler/rustc_mir_transform/src/coroutine.rs
index a0851aa557b..54b13a40e92 100644
--- a/compiler/rustc_mir_transform/src/coroutine.rs
+++ b/compiler/rustc_mir_transform/src/coroutine.rs
@@ -1615,11 +1615,7 @@ impl<'tcx> MirPass<'tcx> for StateTransform {
                 (args.discr_ty(tcx), coroutine_kind.movability() == hir::Movability::Movable)
             }
             _ => {
-                tcx.dcx().span_delayed_bug(
-                    body.span,
-                    format!("unexpected coroutine type {coroutine_ty}"),
-                );
-                return;
+                tcx.dcx().span_bug(body.span, format!("unexpected coroutine type {coroutine_ty}"));
             }
         };
 
diff --git a/compiler/rustc_mir_transform/src/elaborate_drops.rs b/compiler/rustc_mir_transform/src/elaborate_drops.rs
index 8575f552f0a..03d952abad1 100644
--- a/compiler/rustc_mir_transform/src/elaborate_drops.rs
+++ b/compiler/rustc_mir_transform/src/elaborate_drops.rs
@@ -380,7 +380,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
                 LookupResult::Parent(None) => {}
                 LookupResult::Parent(Some(_)) => {
                     if !replace {
-                        self.tcx.dcx().span_delayed_bug(
+                        self.tcx.dcx().span_bug(
                             terminator.source_info.span,
                             format!("drop of untracked value {bb:?}"),
                         );