diff --git a/src/librustc_typeck/check/autoderef.rs b/src/librustc_typeck/check/autoderef.rs index 0dab172230e..2bb00553232 100644 --- a/src/librustc_typeck/check/autoderef.rs +++ b/src/librustc_typeck/check/autoderef.rs @@ -114,10 +114,10 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> { let tcx = self.infcx.tcx; - // + // let trait_ref = TraitRef { def_id: tcx.lang_items().deref_trait()?, - substs: tcx.mk_substs_trait(self.cur_ty, &[]), + substs: tcx.mk_substs_trait(ty, &[]), }; let cause = traits::ObligationCause::misc(self.span, self.body_id);