about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-07-12 17:06:34 +0530
committerGitHub <noreply@github.com>2022-07-12 17:06:34 +0530
commitc0bcbe8a6eebe296c945cdfce22125103409478b (patch)
treec96d3249f60fe28302ab813456499827419f95db /compiler/rustc_mir_transform/src
parent99fc65bc49d351b5466841b638f80676f554041f (diff)
parent988e754691ed754dbbaf25096cfd673dd1da69bc (diff)
downloadrust-c0bcbe8a6eebe296c945cdfce22125103409478b.tar.gz
rust-c0bcbe8a6eebe296c945cdfce22125103409478b.zip
Rollup merge of #99038 - jackh726:earlybinder-cleanup, r=lcnr
Some more `EarlyBinder` cleanups

First commit has a couple unrelated cleanups, but otherwise each commit is self-explanatory

r? rust-lang/types
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/shim.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_mir_transform/src/shim.rs b/compiler/rustc_mir_transform/src/shim.rs
index 3be1783ae33..f3153a64820 100644
--- a/compiler/rustc_mir_transform/src/shim.rs
+++ b/compiler/rustc_mir_transform/src/shim.rs
@@ -537,13 +537,12 @@ fn build_call_shim<'tcx>(
     };
 
     let def_id = instance.def_id();
-    let sig = tcx.fn_sig(def_id);
-    let mut sig = tcx.erase_late_bound_regions(sig);
+    let sig = tcx.bound_fn_sig(def_id);
+    let sig = sig.map_bound(|sig| tcx.erase_late_bound_regions(sig));
 
     assert_eq!(sig_substs.is_some(), !instance.has_polymorphic_mir_body());
-    if let Some(sig_substs) = sig_substs {
-        sig = EarlyBinder(sig).subst(tcx, sig_substs);
-    }
+    let mut sig =
+        if let Some(sig_substs) = sig_substs { sig.subst(tcx, sig_substs) } else { sig.0 };
 
     if let CallKind::Indirect(fnty) = call_kind {
         // `sig` determines our local decls, and thus the callee type in the `Call` terminator. This