use crate::autoderef::Autoderef;
use crate::infer::InferCtxt;
+use crate::traits::NormalizeExt;
use hir::def::CtorOf;
use hir::HirId;
obligated_types: &mut Vec<Ty<'tcx>>,
seen_requirements: &mut FxHashSet<DefId>,
) where
- T: fmt::Display + ToPredicate<'tcx, T>;
+ T: fmt::Display + ToPredicate<'tcx>;
/// Suggest to await before try: future? => future.await?
fn suggest_await_before_try(
obligated_types: &mut Vec<Ty<'tcx>>,
seen_requirements: &mut FxHashSet<DefId>,
) where
- T: fmt::Display,
+ T: fmt::Display + ToPredicate<'tcx>,
{
let tcx = self.tcx;
match *cause_code {
self.tcx.mk_substs_trait(trait_pred.self_ty(), []),
)
});
- let InferOk { value: projection_ty, .. } = self
- .partially_normalize_associated_types_in(
- obligation.cause.clone(),
- obligation.param_env,
- projection_ty,
- );
+ let InferOk { value: projection_ty, .. } =
+ self.at(&obligation.cause, obligation.param_env).normalize(projection_ty);
debug!(
normalized_projection_type = ?self.resolve_vars_if_possible(projection_ty)