extract ConstKind::Unevaluated into a struct

This commit is contained in:
lcnr 2021-03-12 00:01:34 +01:00
parent 41b315a470
commit 43ebac119b
25 changed files with 131 additions and 88 deletions

View file

@ -803,7 +803,12 @@ impl AutoTraitFinder<'tcx> {
}
ty::PredicateKind::ConstEquate(c1, c2) => {
let evaluate = |c: &'tcx ty::Const<'tcx>| {
if let ty::ConstKind::Unevaluated(def, substs, promoted) = c.val {
if let ty::ConstKind::Unevaluated(ty::Unevaluated {
def,
substs,
promoted,
}) = c.val
{
match select.infcx().const_eval_resolve(
obligation.param_env,
def,