Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong argument in autoderef process #71627

Merged
merged 1 commit into from
Apr 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix wrong argument in autoderef process
ldm0 committed Apr 28, 2020

Verified

This commit was signed with the committer’s verified signature.
snyk-bot Snyk bot
commit 8d2f301283ff2dcf10221045d8345e3a38f6f99d
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/autoderef.rs
Original file line number Diff line number Diff line change
@@ -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);