Skip to content

Commit ad9e1e3

Browse files
committed
Use map_bound
1 parent 9935796 commit ad9e1e3

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Diff for: compiler/rustc_mir_transform/src/shim.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -537,13 +537,12 @@ fn build_call_shim<'tcx>(
537537
};
538538

539539
let def_id = instance.def_id();
540-
let sig = tcx.fn_sig(def_id);
541-
let mut sig = tcx.erase_late_bound_regions(sig);
540+
let sig = tcx.bound_fn_sig(def_id);
541+
let sig = sig.map_bound(|sig| tcx.erase_late_bound_regions(sig));
542542

543543
assert_eq!(sig_substs.is_some(), !instance.has_polymorphic_mir_body());
544-
if let Some(sig_substs) = sig_substs {
545-
sig = EarlyBinder(sig).subst(tcx, sig_substs);
546-
}
544+
let mut sig =
545+
if let Some(sig_substs) = sig_substs { sig.subst(tcx, sig_substs) } else { sig.0 };
547546

548547
if let CallKind::Indirect(fnty) = call_kind {
549548
// `sig` determines our local decls, and thus the callee type in the `Call` terminator. This

Diff for: compiler/rustc_trait_selection/src/traits/select/confirmation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_index::bit_set::GrowableBitSet;
1212
use rustc_infer::infer::InferOk;
1313
use rustc_infer::infer::LateBoundRegionConversionTime::HigherRankedType;
1414
use rustc_middle::ty::subst::{GenericArg, GenericArgKind, InternalSubsts, Subst, SubstsRef};
15-
use rustc_middle::ty::{self, EarlyBinder, GenericParamDefKind, Ty, TyCtxt};
15+
use rustc_middle::ty::{self, GenericParamDefKind, Ty, TyCtxt};
1616
use rustc_middle::ty::{ToPolyTraitRef, ToPredicate};
1717
use rustc_span::def_id::DefId;
1818

@@ -555,7 +555,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
555555

556556
let bound_vars = tcx.mk_bound_variable_kinds(bound_vars.into_iter());
557557
let bound =
558-
EarlyBinder(bound.0.kind().skip_binder()).subst(tcx, assoc_ty_substs);
558+
bound.map_bound(|b| b.kind().skip_binder()).subst(tcx, assoc_ty_substs);
559559
tcx.mk_predicate(ty::Binder::bind_with_vars(bound, bound_vars))
560560
};
561561
let normalized_bound = normalize_with_depth_to(

0 commit comments

Comments
 (0)