X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_trait_selection%2Fsrc%2Fautoderef.rs;h=e988c77a064f6a03733c9817ff25a34e10d472b2;hb=dc30b92cc576ed9e097db7fece0af13662de8d8d;hp=af3a7ae248665057659e04d4ac10f6b84596c540;hpb=5ac7e08aaf10d2882c6addcf220872c9390ed91e;p=rust.git diff --git a/compiler/rustc_trait_selection/src/autoderef.rs b/compiler/rustc_trait_selection/src/autoderef.rs index af3a7ae2486..e988c77a064 100644 --- a/compiler/rustc_trait_selection/src/autoderef.rs +++ b/compiler/rustc_trait_selection/src/autoderef.rs @@ -1,6 +1,6 @@ use crate::errors::AutoDerefReachedRecursionLimit; -use crate::infer::InferCtxtExt as _; use crate::traits::query::evaluate_obligation::InferCtxtExt; +use crate::traits::NormalizeExt; use crate::traits::{self, TraitEngine, TraitEngineExt}; use rustc_hir as hir; use rustc_infer::infer::InferCtxt; @@ -138,11 +138,10 @@ fn overloaded_deref_ty(&mut self, ty: Ty<'tcx>) -> Option> { return None; } - let normalized_ty = self.infcx.partially_normalize_associated_types_in( - cause, - self.param_env, - tcx.mk_projection(tcx.lang_items().deref_target()?, trait_ref.substs), - ); + let normalized_ty = self + .infcx + .at(&cause, self.param_env) + .normalize(tcx.mk_projection(tcx.lang_items().deref_target()?, trait_ref.substs)); let mut fulfillcx = >::new_in_snapshot(tcx); let normalized_ty = normalized_ty.into_value_registering_obligations(self.infcx, &mut *fulfillcx);