Skip to content

Commit 75561a5

Browse files
authored
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. -_-
2 parents e3bf870 + 8d2f301 commit 75561a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_typeck/check/autoderef.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
114114

115115
let tcx = self.infcx.tcx;
116116

117-
// <cur_ty as Deref>
117+
// <ty as Deref>
118118
let trait_ref = TraitRef {
119119
def_id: tcx.lang_items().deref_trait()?,
120-
substs: tcx.mk_substs_trait(self.cur_ty, &[]),
120+
substs: tcx.mk_substs_trait(ty, &[]),
121121
};
122122

123123
let cause = traits::ObligationCause::misc(self.span, self.body_id);

0 commit comments

Comments
 (0)