about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/astconv/mod.rs
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2024-02-21 08:55:56 +0000
committerGitHub <noreply@github.com>2024-02-21 08:55:56 +0000
commitd5206c6ecde0cb887518bc9142dcb6ac21cbbe94 (patch)
treef690aca39c073c5e03cc9236cb3d9a3f42802974 /compiler/rustc_hir_analysis/src/astconv/mod.rs
parent0987e41d1ccbae7a8a55fdcde4af0ea76ebfe2d3 (diff)
parent2903bbbc156fb9707b43038af6723844fd4ccf29 (diff)
downloadrust-d5206c6ecde0cb887518bc9142dcb6ac21cbbe94.tar.gz
rust-d5206c6ecde0cb887518bc9142dcb6ac21cbbe94.zip
Rollup merge of #121208 - nnethercote:delayed_bug-to-bug, r=lcnr
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.

This is too dangerous to merge. Increased coverage (fuzzing or a crater run) would likely hit more cases. But it might be useful for people to look at and think about which paths are genuinely unreachable.

r? `@ghost`
Diffstat (limited to 'compiler/rustc_hir_analysis/src/astconv/mod.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/astconv/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/astconv/mod.rs b/compiler/rustc_hir_analysis/src/astconv/mod.rs
index 5d2b76eca15..f374b955d9e 100644
--- a/compiler/rustc_hir_analysis/src/astconv/mod.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/mod.rs
@@ -1237,8 +1237,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
                 // trait reference.
                 let Some(trait_ref) = tcx.impl_trait_ref(impl_def_id) else {
                     // A cycle error occurred, most likely.
-                    let guar = tcx.dcx().span_delayed_bug(span, "expected cycle error");
-                    return Err(guar);
+                    tcx.dcx().span_bug(span, "expected cycle error");
                 };
 
                 self.one_bound_for_assoc_item(