Auto merge of #88166 - BoxyUwU:const-equate-canon, r=lcnr

canonicalize consts before calling try_unify_abstract_consts query

Fixes #88022
Fixes #86953
Fixes #77708
Fixes #82034
Fixes #85031

these ICEs were all caused by calling the `try_unify_abstract_consts` query with inference vars in substs

r? `@lcnr`
This commit is contained in:
bors 2021-08-22 18:00:22 +00:00
commit 91f9806208
12 changed files with 221 additions and 9 deletions

View file

@ -624,10 +624,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
if let (ty::ConstKind::Unevaluated(a), ty::ConstKind::Unevaluated(b)) =
(c1.val, c2.val)
{
if self
.tcx()
.try_unify_abstract_consts(((a.def, a.substs), (b.def, b.substs)))
{
if self.infcx.try_unify_abstract_consts(a, b) {
return Ok(EvaluatedToOk);
}
}