Delay a bug if we try and fail to relate an opaque to itself in TypeRelating
This commit is contained in:
parent
28b6373b1d
commit
534426d0f3
@ -599,6 +599,10 @@ fn tys(&mut self, a: Ty<'tcx>, mut b: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>>
|
|||||||
|
|
||||||
(&ty::Opaque(a_def_id, _), &ty::Opaque(b_def_id, _)) if a_def_id == b_def_id => {
|
(&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| {
|
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) }
|
if a_def_id.is_local() { self.relate_opaques(a, b) } else { Err(err) }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user