Rollup merge of #114123 - oli-obk:tait_wtf, r=WaffleLapkin
Turns out opaque types can have hidden types registered during mir validation See the newly added test's documentation for an explanation. fixes #114121
This commit is contained in:
commit
218e88e5d8
2 changed files with 25 additions and 6 deletions
|
@ -57,12 +57,15 @@ pub fn is_subtype<'tcx>(
|
|||
// we would get unification errors because we're unable to look into opaque types,
|
||||
// even if they're constrained in our current function.
|
||||
for (key, ty) in infcx.take_opaque_types() {
|
||||
span_bug!(
|
||||
ty.hidden_type.span,
|
||||
"{}, {}",
|
||||
tcx.type_of(key.def_id).instantiate(tcx, key.args),
|
||||
ty.hidden_type.ty
|
||||
);
|
||||
let hidden_ty = tcx.type_of(key.def_id).instantiate(tcx, key.args);
|
||||
if hidden_ty != ty.hidden_type.ty {
|
||||
span_bug!(
|
||||
ty.hidden_type.span,
|
||||
"{}, {}",
|
||||
tcx.type_of(key.def_id).instantiate(tcx, key.args),
|
||||
ty.hidden_type.ty
|
||||
);
|
||||
}
|
||||
}
|
||||
errors.is_empty()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue