about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-09-28 13:07:20 +0900
committerGitHub <noreply@github.com>2022-09-28 13:07:20 +0900
commitae2028817a9612b47d40093c95d886c2db97a526 (patch)
tree1c8181c7bd48c4acb23d8006c4473aa445523d12 /compiler/rustc_trait_selection/src/traits
parentbf54cfe2b247abe6f3e90d088f72257fb2352d72 (diff)
parente5776c690328a373ec812471f7a257e6c0920881 (diff)
downloadrust-ae2028817a9612b47d40093c95d886c2db97a526.tar.gz
rust-ae2028817a9612b47d40093c95d886c2db97a526.zip
Rollup merge of #102378 - compiler-errors:issue-102289, r=jackh726
Use already resolved `self_ty` in `confirm_fn_pointer_candidate`

Fixes #102289
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/confirmation.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
index 27fbfb6dd21..dd49dcecf77 100644
--- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
@@ -626,7 +626,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
         // the signature, as evidenced by how we treat it during projection.
         // The safe thing to do here is to liberate it, though, which should
         // have no worse effect than skipping the binder here.
-        let liberated_fn_ty = self.infcx.replace_bound_vars_with_placeholders(obligation.self_ty());
+        let liberated_fn_ty =
+            self.infcx.replace_bound_vars_with_placeholders(obligation.predicate.rebind(self_ty));
         let output_ty = self
             .infcx
             .replace_bound_vars_with_placeholders(liberated_fn_ty.fn_sig(self.tcx()).output());