about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_borrowck/src')
-rw-r--r--compiler/rustc_borrowck/src/type_check/free_region_relations.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_borrowck/src/type_check/free_region_relations.rs b/compiler/rustc_borrowck/src/type_check/free_region_relations.rs
index 897918fb0a4..86d20599a2a 100644
--- a/compiler/rustc_borrowck/src/type_check/free_region_relations.rs
+++ b/compiler/rustc_borrowck/src/type_check/free_region_relations.rs
@@ -311,17 +311,14 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
         // Add implied bounds from impl header.
         if matches!(tcx.def_kind(defining_ty_def_id), DefKind::AssocFn | DefKind::AssocConst) {
             for &(ty, _) in tcx.assumed_wf_types(tcx.local_parent(defining_ty_def_id)) {
-                let Ok(TypeOpOutput { output: norm_ty, constraints: c, .. }) = self
+                let result: Result<_, ErrorGuaranteed> = self
                     .param_env
                     .and(type_op::normalize::Normalize::new(ty))
-                    .fully_perform(self.infcx, span)
-                else {
-                    // Note: this path is currently not reached in any test, so
-                    // any example that triggers this would be worth minimizing
-                    // and converting into a test.
-                    tcx.dcx().span_delayed_bug(span, format!("failed to normalize {ty:?}"));
+                    .fully_perform(self.infcx, span);
+                let Ok(TypeOpOutput { output: norm_ty, constraints: c, .. }) = result else {
                     continue;
                 };
+
                 constraints.extend(c);
 
                 // We currently add implied bounds from the normalized ty only.