Skip to content

Commit e7fdba8

Browse files
authored
Rollup merge of rust-lang#112060 - lcnr:early-binder, r=jackh726
`EarlyBinder::new` -> `EarlyBinder::bind` for consistency with `Binder::bind`. it may make sense to also add `EarlyBinder::dummy` in places where we know that no parameters exist, but I left that out of this PR. r? `@jackh726` `@kylematsuda`
2 parents 65833ed + 08d149c commit e7fdba8

File tree

46 files changed

+60
-60
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+60
-60
lines changed

compiler/rustc_codegen_cranelift/src/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
361361
self.instance.subst_mir_and_normalize_erasing_regions(
362362
self.tcx,
363363
ty::ParamEnv::reveal_all(),
364-
ty::EarlyBinder::new(value),
364+
ty::EarlyBinder::bind(value),
365365
)
366366
}
367367

compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fn make_mir_scope<'ll, 'tcx>(
9393
let callee = cx.tcx.subst_and_normalize_erasing_regions(
9494
instance.substs,
9595
ty::ParamEnv::reveal_all(),
96-
ty::EarlyBinder::new(callee),
96+
ty::EarlyBinder::bind(callee),
9797
);
9898
let callee_fn_abi = cx.fn_abi_of_instance(callee, ty::List::empty());
9999
cx.dbg_scope_fn(callee, callee_fn_abi, None)

compiler/rustc_codegen_ssa/src/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
111111
self.instance.subst_mir_and_normalize_erasing_regions(
112112
self.cx.tcx(),
113113
ty::ParamEnv::reveal_all(),
114-
ty::EarlyBinder::new(value),
114+
ty::EarlyBinder::bind(value),
115115
)
116116
}
117117
}

compiler/rustc_const_eval/src/interpret/eval_context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
497497
.try_subst_mir_and_normalize_erasing_regions(
498498
*self.tcx,
499499
self.param_env,
500-
ty::EarlyBinder::new(value),
500+
ty::EarlyBinder::bind(value),
501501
)
502502
.map_err(|_| err_inval!(TooGeneric))
503503
}

compiler/rustc_hir_analysis/src/astconv/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
12801280
// params (and trait ref's late bound params). This logic is very similar to
12811281
// `Predicate::subst_supertrait`, and it's no coincidence why.
12821282
let shifted_output = tcx.shift_bound_var_indices(num_bound_vars, output);
1283-
let subst_output = ty::EarlyBinder::new(shifted_output).subst(tcx, substs);
1283+
let subst_output = ty::EarlyBinder::bind(shifted_output).subst(tcx, substs);
12841284

12851285
let bound_vars = tcx.late_bound_vars(binding.hir_id);
12861286
ty::Binder::bind_with_vars(subst_output, bound_vars)

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -796,14 +796,14 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
796796
})
797797
});
798798
debug!(%ty);
799-
collected_tys.insert(def_id, ty::EarlyBinder::new(ty));
799+
collected_tys.insert(def_id, ty::EarlyBinder::bind(ty));
800800
}
801801
Err(err) => {
802802
let reported = tcx.sess.delay_span_bug(
803803
return_span,
804804
format!("could not fully resolve: {ty} => {err:?}"),
805805
);
806-
collected_tys.insert(def_id, ty::EarlyBinder::new(tcx.ty_error(reported)));
806+
collected_tys.insert(def_id, ty::EarlyBinder::bind(tcx.ty_error(reported)));
807807
}
808808
}
809809
}

compiler/rustc_hir_analysis/src/check/dropck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
128128
// We don't need to normalize this param-env or anything, since we're only
129129
// substituting it with free params, so no additional param-env normalization
130130
// can occur on top of what has been done in the param_env query itself.
131-
let param_env = ty::EarlyBinder::new(tcx.param_env(adt_def_id))
131+
let param_env = ty::EarlyBinder::bind(tcx.param_env(adt_def_id))
132132
.subst(tcx, adt_to_impl_substs)
133133
.with_constness(tcx.constness(drop_impl_def_id));
134134

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
14071407
}
14081408
let mut param_count = CountParams::default();
14091409
let has_region = pred.visit_with(&mut param_count).is_break();
1410-
let substituted_pred = ty::EarlyBinder::new(pred).subst(tcx, substs);
1410+
let substituted_pred = ty::EarlyBinder::bind(pred).subst(tcx, substs);
14111411
// Don't check non-defaulted params, dependent defaults (including lifetimes)
14121412
// or preds with multiple params.
14131413
if substituted_pred.has_non_region_param() || param_count.params.len() > 1 || has_region

compiler/rustc_hir_analysis/src/collect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<ty::PolyFnSig<
11241124
bug!("unexpected sort of node in fn_sig(): {:?}", x);
11251125
}
11261126
};
1127-
ty::EarlyBinder::new(output)
1127+
ty::EarlyBinder::bind(output)
11281128
}
11291129

11301130
fn infer_return_ty_for_fn_sig<'tcx>(
@@ -1312,7 +1312,7 @@ fn impl_trait_ref(
13121312
check_impl_constness(tcx, impl_.constness, ast_trait_ref),
13131313
)
13141314
})
1315-
.map(ty::EarlyBinder::new)
1315+
.map(ty::EarlyBinder::bind)
13161316
}
13171317

13181318
fn check_impl_constness(

compiler/rustc_hir_analysis/src/collect/item_bounds.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub(super) fn explicit_item_bounds(
8686
Some(ty::ImplTraitInTraitData::Trait { opaque_def_id, .. }) => {
8787
let item = tcx.hir().get_by_def_id(opaque_def_id.expect_local()).expect_item();
8888
let opaque_ty = item.expect_opaque_ty();
89-
return ty::EarlyBinder::new(opaque_type_bounds(
89+
return ty::EarlyBinder::bind(opaque_type_bounds(
9090
tcx,
9191
opaque_def_id.expect_local(),
9292
opaque_ty.bounds,
@@ -124,7 +124,7 @@ pub(super) fn explicit_item_bounds(
124124
}
125125
_ => bug!("item_bounds called on {:?}", def_id),
126126
};
127-
ty::EarlyBinder::new(bounds)
127+
ty::EarlyBinder::bind(bounds)
128128
}
129129

130130
pub(super) fn item_bounds(

compiler/rustc_hir_analysis/src/collect/type_of.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
323323
return map[&assoc_item.trait_item_def_id.unwrap()];
324324
}
325325
Err(_) => {
326-
return ty::EarlyBinder::new(tcx.ty_error_with_message(
326+
return ty::EarlyBinder::bind(tcx.ty_error_with_message(
327327
DUMMY_SP,
328328
"Could not collect return position impl trait in trait tys",
329329
));
@@ -497,7 +497,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
497497
bug!("unexpected sort of node in type_of(): {:?}", x);
498498
}
499499
};
500-
ty::EarlyBinder::new(output)
500+
ty::EarlyBinder::bind(output)
501501
}
502502

503503
fn infer_placeholder_type<'a>(

compiler/rustc_hir_analysis/src/outlives/explicit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<'tcx> ExplicitPredicatesMap<'tcx> {
6868
}
6969
}
7070

71-
ty::EarlyBinder::new(required_predicates)
71+
ty::EarlyBinder::bind(required_predicates)
7272
})
7373
}
7474
}

compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub(super) fn infer_predicates(
7474
if item_required_predicates.len() > item_predicates_len {
7575
predicates_added = true;
7676
global_inferred_outlives
77-
.insert(item_did.to_def_id(), ty::EarlyBinder::new(item_required_predicates));
77+
.insert(item_did.to_def_id(), ty::EarlyBinder::bind(item_required_predicates));
7878
}
7979
}
8080

compiler/rustc_metadata/src/rmeta/decoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
858858
} else {
859859
tcx.arena.alloc_from_iter(lazy.decode((self, tcx)))
860860
};
861-
ty::EarlyBinder::new(&*output)
861+
ty::EarlyBinder::bind(&*output)
862862
}
863863

864864
fn get_variant(

compiler/rustc_metadata/src/rmeta/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
17301730
ty::Closure(_, substs) => {
17311731
let constness = self.tcx.constness(def_id.to_def_id());
17321732
self.tables.constness.set_some(def_id.to_def_id().index, constness);
1733-
record!(self.tables.fn_sig[def_id.to_def_id()] <- ty::EarlyBinder::new(substs.as_closure().sig()));
1733+
record!(self.tables.fn_sig[def_id.to_def_id()] <- ty::EarlyBinder::bind(substs.as_closure().sig()));
17341734
}
17351735

17361736
_ => bug!("closure that is neither generator nor closure"),

compiler/rustc_middle/src/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ impl<'tcx> Body<'tcx> {
476476
/// Returns the return type; it always return first element from `local_decls` array.
477477
#[inline]
478478
pub fn bound_return_ty(&self) -> ty::EarlyBinder<Ty<'tcx>> {
479-
ty::EarlyBinder::new(self.local_decls[RETURN_PLACE].ty)
479+
ty::EarlyBinder::bind(self.local_decls[RETURN_PLACE].ty)
480480
}
481481

482482
/// Gets the location of the terminator for the given block.

compiler/rustc_middle/src/ty/adt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ impl<'tcx> AdtDef<'tcx> {
573573
/// Due to normalization being eager, this applies even if
574574
/// the associated type is behind a pointer (e.g., issue #31299).
575575
pub fn sized_constraint(self, tcx: TyCtxt<'tcx>) -> ty::EarlyBinder<&'tcx [Ty<'tcx>]> {
576-
ty::EarlyBinder::new(tcx.adt_sized_constraint(self.did()))
576+
ty::EarlyBinder::bind(tcx.adt_sized_constraint(self.did()))
577577
}
578578
}
579579

compiler/rustc_middle/src/ty/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,5 +254,5 @@ pub fn const_param_default(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBind
254254
"`const_param_default` expected a generic parameter with a constant"
255255
),
256256
};
257-
ty::EarlyBinder::new(Const::from_anon_const(tcx, default_def_id))
257+
ty::EarlyBinder::bind(Const::from_anon_const(tcx, default_def_id))
258258
}

compiler/rustc_middle/src/ty/generics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl<'tcx> GenericPredicates<'tcx> {
343343
substs: SubstsRef<'tcx>,
344344
) -> impl Iterator<Item = (Predicate<'tcx>, Span)> + DoubleEndedIterator + ExactSizeIterator
345345
{
346-
EarlyBinder::new(self.predicates).subst_iter_copied(tcx, substs)
346+
EarlyBinder::bind(self.predicates).subst_iter_copied(tcx, substs)
347347
}
348348

349349
#[instrument(level = "debug", skip(self, tcx))]
@@ -358,7 +358,7 @@ impl<'tcx> GenericPredicates<'tcx> {
358358
}
359359
instantiated
360360
.predicates
361-
.extend(self.predicates.iter().map(|(p, _)| EarlyBinder::new(*p).subst(tcx, substs)));
361+
.extend(self.predicates.iter().map(|(p, _)| EarlyBinder::bind(*p).subst(tcx, substs)));
362362
instantiated.spans.extend(self.predicates.iter().map(|(_, sp)| *sp));
363363
}
364364

compiler/rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl<'tcx> InhabitedPredicate<'tcx> {
158158
fn subst_opt(self, tcx: TyCtxt<'tcx>, substs: ty::SubstsRef<'tcx>) -> Option<Self> {
159159
match self {
160160
Self::ConstIsZero(c) => {
161-
let c = ty::EarlyBinder::new(c).subst(tcx, substs);
161+
let c = ty::EarlyBinder::bind(c).subst(tcx, substs);
162162
let pred = match c.kind().try_to_target_usize(tcx) {
163163
Some(0) => Self::True,
164164
Some(1..) => Self::False,
@@ -167,7 +167,7 @@ impl<'tcx> InhabitedPredicate<'tcx> {
167167
Some(pred)
168168
}
169169
Self::GenericType(t) => {
170-
Some(ty::EarlyBinder::new(t).subst(tcx, substs).inhabited_predicate(tcx))
170+
Some(ty::EarlyBinder::bind(t).subst(tcx, substs).inhabited_predicate(tcx))
171171
}
172172
Self::And(&[a, b]) => match a.subst_opt(tcx, substs) {
173173
None => b.subst_opt(tcx, substs).map(|b| a.and(tcx, b)),

compiler/rustc_middle/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ impl<'tcx> Predicate<'tcx> {
764764
let shifted_pred =
765765
tcx.shift_bound_var_indices(trait_bound_vars.len(), bound_pred.skip_binder());
766766
// 2) Self: Bar1<'a, '^0.1> -> T: Bar1<'^0.0, '^0.1>
767-
let new = EarlyBinder::new(shifted_pred).subst(tcx, trait_ref.skip_binder().substs);
767+
let new = EarlyBinder::bind(shifted_pred).subst(tcx, trait_ref.skip_binder().substs);
768768
// 3) ['x] + ['b] -> ['x, 'b]
769769
let bound_vars =
770770
tcx.mk_bound_variable_kinds_from_iter(trait_bound_vars.iter().chain(pred_bound_vars));

compiler/rustc_middle/src/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl<'tcx> GeneratorSubsts<'tcx> {
568568
let layout = tcx.generator_layout(def_id).unwrap();
569569
layout.variant_fields.iter().map(move |variant| {
570570
variant.iter().map(move |field| {
571-
ty::EarlyBinder::new(layout.field_tys[*field].ty).subst(tcx, self.substs)
571+
ty::EarlyBinder::bind(layout.field_tys[*field].ty).subst(tcx, self.substs)
572572
})
573573
})
574574
}

compiler/rustc_middle/src/ty/subst.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ impl<'tcx, T> !TypeFoldable<TyCtxt<'tcx>> for ty::EarlyBinder<T> {}
545545
impl<'tcx, T> !TypeVisitable<TyCtxt<'tcx>> for ty::EarlyBinder<T> {}
546546

547547
impl<T> EarlyBinder<T> {
548-
pub fn new(inner: T) -> EarlyBinder<T> {
548+
pub fn bind(inner: T) -> EarlyBinder<T> {
549549
EarlyBinder(inner)
550550
}
551551

compiler/rustc_middle/src/ty/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ impl<'tcx> TyCtxt<'tcx> {
709709
.as_ref()
710710
.map_or_else(|| [].iter(), |l| l.field_tys.iter())
711711
.filter(|decl| !decl.ignore_for_traits)
712-
.map(|decl| ty::EarlyBinder::new(decl.ty))
712+
.map(|decl| ty::EarlyBinder::bind(decl.ty))
713713
}
714714

715715
/// Normalizes all opaque types in the given value, replacing them

compiler/rustc_middle/src/values.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ impl<'tcx> Value<TyCtxt<'tcx>, DepKind> for Representability {
9696

9797
impl<'tcx> Value<TyCtxt<'tcx>, DepKind> for ty::EarlyBinder<Ty<'_>> {
9898
fn from_cycle_error(tcx: TyCtxt<'tcx>, cycle: &[QueryInfo<DepKind>]) -> Self {
99-
ty::EarlyBinder::new(Ty::from_cycle_error(tcx, cycle))
99+
ty::EarlyBinder::bind(Ty::from_cycle_error(tcx, cycle))
100100
}
101101
}
102102

103103
impl<'tcx> Value<TyCtxt<'tcx>, DepKind> for ty::EarlyBinder<ty::Binder<'_, ty::FnSig<'_>>> {
104104
fn from_cycle_error(tcx: TyCtxt<'tcx>, cycle: &[QueryInfo<DepKind>]) -> Self {
105-
ty::EarlyBinder::new(ty::Binder::from_cycle_error(tcx, cycle))
105+
ty::EarlyBinder::bind(ty::Binder::from_cycle_error(tcx, cycle))
106106
}
107107
}
108108

compiler/rustc_mir_transform/src/function_item_references.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'tcx> FunctionItemRefChecker<'_, 'tcx> {
8383
// If the inner type matches the type bound by `Pointer`
8484
if inner_ty == bound_ty {
8585
// Do a substitution using the parameters from the callsite
86-
let subst_ty = EarlyBinder::new(inner_ty).subst(self.tcx, substs_ref);
86+
let subst_ty = EarlyBinder::bind(inner_ty).subst(self.tcx, substs_ref);
8787
if let Some((fn_id, fn_substs)) =
8888
FunctionItemRefChecker::is_fn_ref(subst_ty)
8989
{

compiler/rustc_mir_transform/src/inline.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<'tcx> Inliner<'tcx> {
192192
let Ok(callee_body) = callsite.callee.try_subst_mir_and_normalize_erasing_regions(
193193
self.tcx,
194194
self.param_env,
195-
ty::EarlyBinder::new(callee_body.clone()),
195+
ty::EarlyBinder::bind(callee_body.clone()),
196196
) else {
197197
return Err("failed to normalize callee body");
198198
};
@@ -455,7 +455,7 @@ impl<'tcx> Inliner<'tcx> {
455455
// If the place doesn't actually need dropping, treat it like a regular goto.
456456
let ty = callsite
457457
.callee
458-
.subst_mir(self.tcx, ty::EarlyBinder::new(&place.ty(callee_body, tcx).ty));
458+
.subst_mir(self.tcx, ty::EarlyBinder::bind(&place.ty(callee_body, tcx).ty));
459459
if ty.needs_drop(tcx, self.param_env) && let UnwindAction::Cleanup(unwind) = unwind {
460460
work_list.push(unwind);
461461
}
@@ -790,7 +790,7 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
790790
// If the place doesn't actually need dropping, treat it like a regular goto.
791791
let ty = self
792792
.instance
793-
.subst_mir(tcx, ty::EarlyBinder::new(&place.ty(self.callee_body, tcx).ty));
793+
.subst_mir(tcx, ty::EarlyBinder::bind(&place.ty(self.callee_body, tcx).ty));
794794
if ty.needs_drop(tcx, self.param_env) {
795795
self.cost += CALL_PENALTY;
796796
if let UnwindAction::Cleanup(_) = unwind {
@@ -801,7 +801,7 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
801801
}
802802
}
803803
TerminatorKind::Call { func: Operand::Constant(ref f), unwind, .. } => {
804-
let fn_ty = self.instance.subst_mir(tcx, ty::EarlyBinder::new(&f.literal.ty()));
804+
let fn_ty = self.instance.subst_mir(tcx, ty::EarlyBinder::bind(&f.literal.ty()));
805805
self.cost += if let ty::FnDef(def_id, _) = *fn_ty.kind() && tcx.is_intrinsic(def_id) {
806806
// Don't give intrinsics the extra penalty for calls
807807
INSTR_COST

compiler/rustc_mir_transform/src/inline/cycle.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(crate) fn mir_callgraph_reachable<'tcx>(
4747
let Ok(substs) = caller.try_subst_mir_and_normalize_erasing_regions(
4848
tcx,
4949
param_env,
50-
ty::EarlyBinder::new(substs),
50+
ty::EarlyBinder::bind(substs),
5151
) else {
5252
trace!(?caller, ?param_env, ?substs, "cannot normalize, skipping");
5353
continue;

compiler/rustc_mir_transform/src/shim.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
6969
// of this function. Is this intentional?
7070
if let Some(ty::Generator(gen_def_id, substs, _)) = ty.map(Ty::kind) {
7171
let body = tcx.optimized_mir(*gen_def_id).generator_drop().unwrap();
72-
let body = EarlyBinder::new(body.clone()).subst(tcx, substs);
72+
let body = EarlyBinder::bind(body.clone()).subst(tcx, substs);
7373
debug!("make_shim({:?}) = {:?}", instance, body);
7474
return body;
7575
}

compiler/rustc_monomorphize/src/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ impl<'a, 'tcx> MirNeighborCollector<'a, 'tcx> {
677677
self.instance.subst_mir_and_normalize_erasing_regions(
678678
self.tcx,
679679
ty::ParamEnv::reveal_all(),
680-
ty::EarlyBinder::new(value),
680+
ty::EarlyBinder::bind(value),
681681
)
682682
}
683683
}

compiler/rustc_monomorphize/src/util.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ pub(crate) fn dump_closure_profile<'tcx>(tcx: TyCtxt<'tcx>, closure_instance: In
2929
let before_feature_tys = tcx.subst_and_normalize_erasing_regions(
3030
closure_instance.substs,
3131
param_env,
32-
ty::EarlyBinder::new(before_feature_tys),
32+
ty::EarlyBinder::bind(before_feature_tys),
3333
);
3434
let after_feature_tys = tcx.subst_and_normalize_erasing_regions(
3535
closure_instance.substs,
3636
param_env,
37-
ty::EarlyBinder::new(after_feature_tys),
37+
ty::EarlyBinder::bind(after_feature_tys),
3838
);
3939

4040
let new_size = tcx

compiler/rustc_symbol_mangling/src/v0.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ impl<'tcx> Printer<'tcx> for &mut SymbolMangler<'tcx> {
274274

275275
let mut param_env = self.tcx.param_env_reveal_all_normalized(impl_def_id);
276276
if !substs.is_empty() {
277-
param_env = EarlyBinder::new(param_env).subst(self.tcx, substs);
277+
param_env = EarlyBinder::bind(param_env).subst(self.tcx, substs);
278278
}
279279

280280
match &mut impl_trait_ref {

compiler/rustc_trait_selection/src/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ fn is_impossible_method(tcx: TyCtxt<'_>, (impl_def_id, trait_item_def_id): (DefI
487487
tcx,
488488
ObligationCause::dummy_with_span(*span),
489489
param_env,
490-
ty::EarlyBinder::new(*pred).subst(tcx, impl_trait_ref.substs),
490+
ty::EarlyBinder::bind(*pred).subst(tcx, impl_trait_ref.substs),
491491
)
492492
})
493493
});

compiler/rustc_trait_selection/src/traits/object_safety.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ fn receiver_for_self_ty<'tcx>(
642642
if param.index == 0 { self_ty.into() } else { tcx.mk_param_from_def(param) }
643643
});
644644

645-
let result = EarlyBinder::new(receiver_ty).subst(tcx, substs);
645+
let result = EarlyBinder::bind(receiver_ty).subst(tcx, substs);
646646
debug!(
647647
"receiver_for_self_ty({:?}, {:?}, {:?}) = {:?}",
648648
receiver_ty, self_ty, method_def_id, result

0 commit comments

Comments
 (0)