debug!(?normalized_ty, ?obligations, "project_and_unify_type result");
let infcx = selcx.infcx();
- match infcx
- .at(&obligation.cause, obligation.param_env)
- .eq(normalized_ty, obligation.predicate.ty)
- {
+ // FIXME(associated_const_equality): Handle consts here as well as types.
+ let obligation_pred_ty = obligation.predicate.term.ty().unwrap();
+ match infcx.at(&obligation.cause, obligation.param_env).eq(normalized_ty, obligation_pred_ty) {
Ok(InferOk { obligations: inferred_obligations, value: () }) => {
obligations.extend(inferred_obligations);
Ok(Ok(Some(obligations)))
gen_sig,
)
.map_bound(|(trait_ref, yield_ty, return_ty)| {
- let name = tcx.associated_item(obligation.predicate.item_def_id).ident.name;
+ let name = tcx.associated_item(obligation.predicate.item_def_id).name;
let ty = if name == sym::Return {
return_ty
} else if name == sym::Yield {
substs: trait_ref.substs,
item_def_id: obligation.predicate.item_def_id,
},
- ty,
+ term: ty.into(),
}
});
let predicate = ty::ProjectionPredicate {
projection_ty: ty::ProjectionTy { substs, item_def_id: discriminant_def_id },
- ty: self_ty.discriminant_ty(tcx),
+ term: self_ty.discriminant_ty(tcx).into(),
};
// We get here from `poly_project_and_unify_type` which replaces bound vars
let predicate = ty::ProjectionPredicate {
projection_ty: ty::ProjectionTy { substs, item_def_id: metadata_def_id },
- ty: metadata_ty,
+ term: metadata_ty.into(),
};
confirm_param_env_candidate(selcx, obligation, ty::Binder::dummy(predicate), false)
substs: trait_ref.substs,
item_def_id: fn_once_output_def_id,
},
- ty: ret_type,
+ term: ret_type.into(),
});
confirm_param_env_candidate(selcx, obligation, predicate, true)
Ok(InferOk { value: _, obligations }) => {
nested_obligations.extend(obligations);
assoc_ty_own_obligations(selcx, obligation, &mut nested_obligations);
- Progress { ty: cache_entry.ty, obligations: nested_obligations }
+ // FIXME(associated_const_equality): Handle consts here as well? Maybe this progress type should just take
+ // a term instead.
+ Progress { ty: cache_entry.term.ty().unwrap(), obligations: nested_obligations }
}
Err(e) => {
let msg = format!(
// just return Error.
debug!(
"confirm_impl_candidate: no associated type {:?} for {:?}",
- assoc_ty.item.ident, obligation.predicate
+ assoc_ty.item.name, obligation.predicate
);
return Progress { ty: tcx.ty_error(), obligations: nested };
}