Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC

Fix wrong argument in autoderef process

The `overloaded_deref_ty` is a function for derefencing a type which overloads the `Deref` trait. But actually this function never uses the parameter pushed in until this PR. -_-
This commit is contained in:
Dylan DPC 2020-04-29 19:39:34 +02:00 committed by GitHub
commit 75561a56ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);