Skip to content

Commit 595550a

Browse files
committed
delay bug in RPITIT refinement checking with resolution errors
1 parent d929a42 commit 595550a

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_hir_analysis/src/check/compare_impl_item

1 file changed

+4
-4
lines changed

compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ pub(super) fn check_refining_return_position_impl_trait_in_trait<'tcx>(
171171
}
172172
// Resolve any lifetime variables that may have been introduced during normalization.
173173
let Ok((trait_bounds, impl_bounds)) = infcx.fully_resolve((trait_bounds, impl_bounds)) else {
174-
// This code path is not reached in any tests, but may be reachable. If
175-
// this is triggered, it should be converted to `delayed_bug` and the
176-
// triggering case turned into a test.
177-
tcx.dcx().bug("encountered errors when checking RPITIT refinement (resolution)");
174+
// If resolution didn't fully complete, we cannot continue checking RPITIT refinement, and
175+
// delay a bug as the original code contains load-bearing errors.
176+
tcx.dcx().delayed_bug("encountered errors when checking RPITIT refinement (resolution)");
177+
return;
178178
};
179179

180180
// For quicker lookup, use an `IndexSet` (we don't use one earlier because

0 commit comments

Comments
 (0)