Skip to content

Commit

Permalink
Delay a bug if we try and fail to relate an opaque to itself in TypeR…
Browse files Browse the repository at this point in the history
…elating
  • Loading branch information
compiler-errors committed Aug 10, 2022
1 parent 28b6373 commit 534426d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_infer/src/infer/nll_relate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,10 @@ where

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

0 comments on commit 534426d

Please sign in to comment.