Skip to content

Commit 534426d

Browse files
Delay a bug if we try and fail to relate an opaque to itself in TypeRelating
1 parent 28b6373 commit 534426d

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_infer/src/infer/nll_relate

1 file changed

+4
-0
lines changed

compiler/rustc_infer/src/infer/nll_relate/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,10 @@ where
599599

600600
(&ty::Opaque(a_def_id, _), &ty::Opaque(b_def_id, _)) if a_def_id == b_def_id => {
601601
infcx.commit_if_ok(|_| infcx.super_combine_tys(self, a, b)).or_else(|err| {
602+
self.tcx().sess.delay_span_bug(
603+
self.delegate.span(),
604+
"failure to relate an opaque to itself should result in an error later on",
605+
);
602606
if a_def_id.is_local() { self.relate_opaques(a, b) } else { Err(err) }
603607
})
604608
}

0 commit comments

Comments
 (0)