Skip to content

Commit 2fc94ce

Browse files
committed
Remove an unnecessary span_delayed_bug call.
The existing code calls a function that returns `Result<_, ErrorGuaranteed>`, and then calls `span_delayed_bug` pointlessly in the `Err` case.
1 parent 829308e commit 2fc94ce

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

compiler/rustc_borrowck/src/type_check/free_region_relations.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,17 +311,14 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
311311
// Add implied bounds from impl header.
312312
if matches!(tcx.def_kind(defining_ty_def_id), DefKind::AssocFn | DefKind::AssocConst) {
313313
for &(ty, _) in tcx.assumed_wf_types(tcx.local_parent(defining_ty_def_id)) {
314-
let Ok(TypeOpOutput { output: norm_ty, constraints: c, .. }) = self
314+
let result: Result<_, ErrorGuaranteed> = self
315315
.param_env
316316
.and(type_op::normalize::Normalize::new(ty))
317-
.fully_perform(self.infcx, span)
318-
else {
319-
// Note: this path is currently not reached in any test, so
320-
// any example that triggers this would be worth minimizing
321-
// and converting into a test.
322-
tcx.dcx().span_delayed_bug(span, format!("failed to normalize {ty:?}"));
317+
.fully_perform(self.infcx, span);
318+
let Ok(TypeOpOutput { output: norm_ty, constraints: c, .. }) = result else {
323319
continue;
324320
};
321+
325322
constraints.extend(c);
326323

327324
// We currently add implied bounds from the normalized ty only.

0 commit comments

Comments
 (0)