Skip to content

Commit

Permalink
Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC
Browse files Browse the repository at this point in the history
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. -_-
  • Loading branch information
Dylan-DPC committed Apr 29, 2020
2 parents e3bf870 + 8d2f301 commit 75561a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/autoderef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 75561a5

Please sign in to comment.