about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-04-29 19:39:34 +0200
committerGitHub <noreply@github.com>2020-04-29 19:39:34 +0200
commit75561a56ac57c47762b5ddddf7bb2e6798d98e7c (patch)
tree82ec64f066d4e3bf6ef6f20f8456f32fb5286588 /src
parente3bf8709db5e136949cc547e7f5d27e559a95624 (diff)
parent8d2f301283ff2dcf10221045d8345e3a38f6f99d (diff)
downloadrust-75561a56ac57c47762b5ddddf7bb2e6798d98e7c.tar.gz
rust-75561a56ac57c47762b5ddddf7bb2e6798d98e7c.zip
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. -_-
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/check/autoderef.rs4
1 files changed, 2 insertions, 2 deletions
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;
 
-        // <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);