about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-11-24 19:55:47 +0000
committerMichael Goulet <michael@errs.io>2022-11-24 21:50:04 +0000
commitd945967779f8f4c72cb50e0793b039e36ecb9213 (patch)
tree7abe32b46e621c691e322159e09a9eeb42a016b8 /compiler/rustc_trait_selection/src/traits
parentc7330c9fe82b698831105fd31f611fb46586fd3c (diff)
downloadrust-d945967779f8f4c72cb50e0793b039e36ecb9213.tar.gz
rust-d945967779f8f4c72cb50e0793b039e36ecb9213.zip
Remove comment, simplify since we asserted fn ptr Self type has no bound vars
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/confirmation.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
index db0f230cf8d..e46441001b5 100644
--- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
@@ -605,7 +605,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
     {
         debug!(?obligation, "confirm_fn_pointer_candidate");
 
-        // Okay to skip binder; it is reintroduced below.
         let self_ty = self
             .infcx
             .shallow_resolve(obligation.self_ty().no_bound_vars())
@@ -624,15 +623,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
 
         // Confirm the `type Output: Sized;` bound that is present on `FnOnce`
         let cause = obligation.derived_cause(BuiltinDerivedObligation);
-        // The binder on the Fn obligation is "less" important than the one on
-        // 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.predicate.rebind(self_ty));
-        let output_ty = self
-            .infcx
-            .replace_bound_vars_with_placeholders(liberated_fn_ty.fn_sig(self.tcx()).output());
+        let output_ty = self.infcx.replace_bound_vars_with_placeholders(sig.output());
         let output_ty = normalize_with_depth_to(
             self,
             obligation.param_env,