Fix wrong argument in autoderef process

This commit is contained in:
Donough Liu 2020-04-28 08:05:24 +08:00
parent ec1f28f961
commit 8d2f301283

View File

@ -114,10 +114,10 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
let tcx = self.infcx.tcx;
// <cur_ty as Deref>
// <ty as Deref>
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);