Skip to content

Commit d560bb5

Browse files
committed
Use .mk().* instead of .mk_* part 1
1 parent 68c0f9f commit d560bb5

File tree

57 files changed

+126
-121
lines changed

Some content is hidden

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

57 files changed

+126
-121
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15171517
assert!(root_place.projection.is_empty());
15181518
let proper_span = self.body.local_decls[root_place.local].source_info.span;
15191519

1520-
let root_place_projection = self.infcx.tcx.mk_place_elems(root_place.projection);
1520+
let root_place_projection = self.infcx.tcx.mk().place_elems(root_place.projection);
15211521

15221522
if self.access_place_error_reported.contains(&(
15231523
Place { local: root_place.local, projection: root_place_projection },

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2618,7 +2618,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
26182618
DefKind::InlineConst => substs.as_inline_const().parent_substs(),
26192619
other => bug!("unexpected item {:?}", other),
26202620
};
2621-
let parent_substs = tcx.mk_substs(parent_substs);
2621+
let parent_substs = tcx.mk().substs(parent_substs);
26222622

26232623
assert_eq!(typeck_root_substs.len(), parent_substs.len());
26242624
if let Err(_) = self.eq_substs(

compiler/rustc_codegen_cranelift/src/main_shim.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub(crate) fn maybe_create_entry_wrapper(
119119
tcx,
120120
ParamEnv::reveal_all(),
121121
report.def_id,
122-
tcx.mk_substs(&[GenericArg::from(main_ret_ty)]),
122+
tcx.mk().substs(&[GenericArg::from(main_ret_ty)]),
123123
)
124124
.unwrap()
125125
.unwrap()
@@ -146,7 +146,7 @@ pub(crate) fn maybe_create_entry_wrapper(
146146
tcx,
147147
ParamEnv::reveal_all(),
148148
start_def_id,
149-
tcx.mk_substs(&[main_ret_ty.into()]),
149+
tcx.mk().substs(&[main_ret_ty.into()]),
150150
)
151151
.unwrap()
152152
.unwrap()

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ fn upstream_monomorphizations_provider(
376376
ExportedSymbol::Generic(def_id, substs) => (def_id, substs),
377377
ExportedSymbol::DropGlue(ty) => {
378378
if let Some(drop_in_place_fn_def_id) = drop_in_place_fn_def_id {
379-
(drop_in_place_fn_def_id, tcx.mk_substs(&[ty.into()]))
379+
(drop_in_place_fn_def_id, tcx.mk().substs(&[ty.into()]))
380380
} else {
381381
// `drop_in_place` in place does not exist, don't try
382382
// to use it.

compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
477477
cx.tcx(),
478478
ty::ParamEnv::reveal_all(),
479479
start_def_id,
480-
cx.tcx().mk_substs(&[main_ret_ty.into()]),
480+
cx.tcx().mk().substs(&[main_ret_ty.into()]),
481481
)
482482
.unwrap()
483483
.unwrap(),

compiler/rustc_const_eval/src/const_eval/eval_queries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub(super) fn op_to_const<'tcx>(
180180
(ecx.tcx.global_alloc(alloc_id).unwrap_memory(), offset.bytes())
181181
}
182182
(None, _offset) => (
183-
ecx.tcx.mk_const_alloc(Allocation::from_bytes_byte_aligned_immutable(
183+
ecx.tcx.mk().const_alloc(Allocation::from_bytes_byte_aligned_immutable(
184184
b"" as &[u8],
185185
)),
186186
0,

compiler/rustc_const_eval/src/interpret/intern.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn intern_shallow<'rt, 'mir, 'tcx, M: CompileTimeMachine<'mir, 'tcx, const_eval:
135135
};
136136
// link the alloc id to the actual allocation
137137
leftover_allocations.extend(alloc.provenance().ptrs().iter().map(|&(_, alloc_id)| alloc_id));
138-
let alloc = tcx.mk_const_alloc(alloc);
138+
let alloc = tcx.mk().const_alloc(alloc);
139139
tcx.set_alloc_id_memory(alloc_id, alloc);
140140
None
141141
}
@@ -437,7 +437,7 @@ pub fn intern_const_alloc_recursive<
437437
alloc.mutability = Mutability::Not;
438438
}
439439
}
440-
let alloc = tcx.mk_const_alloc(alloc);
440+
let alloc = tcx.mk().const_alloc(alloc);
441441
tcx.set_alloc_id_memory(alloc_id, alloc);
442442
for &(_, alloc_id) in alloc.inner().provenance().ptrs().iter() {
443443
if leftover_allocations.insert(alloc_id) {
@@ -479,6 +479,6 @@ impl<'mir, 'tcx: 'mir, M: super::intern::CompileTimeMachine<'mir, 'tcx, !>>
479479
f(self, &dest.into())?;
480480
let mut alloc = self.memory.alloc_map.remove(&dest.ptr.provenance.unwrap()).unwrap().1;
481481
alloc.mutability = Mutability::Not;
482-
Ok(self.tcx.mk_const_alloc(alloc))
482+
Ok(self.tcx.mk().const_alloc(alloc))
483483
}
484484
}

compiler/rustc_const_eval/src/interpret/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn numeric_intrinsic<Prov>(name: Symbol, bits: u128, kind: Primitive) -> Scalar<
4545
pub(crate) fn alloc_type_name<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> ConstAllocation<'tcx> {
4646
let path = crate::util::type_name(tcx, ty);
4747
let alloc = Allocation::from_bytes_byte_aligned_immutable(path.into_bytes());
48-
tcx.mk_const_alloc(alloc)
48+
tcx.mk().const_alloc(alloc)
4949
}
5050

5151
/// The logic for all nullary intrinsics is implemented here. These intrinsics don't get evaluated

compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
9696
let loc_ty = self
9797
.tcx
9898
.type_of(self.tcx.require_lang_item(LangItem::PanicLocation, None))
99-
.subst(*self.tcx, self.tcx.mk_substs(&[self.tcx.lifetimes.re_erased.into()]));
99+
.subst(*self.tcx, self.tcx.mk().substs(&[self.tcx.lifetimes.re_erased.into()]));
100100
let loc_layout = self.layout_of(loc_ty).unwrap();
101101
let location = self.allocate(loc_layout, MemoryKind::CallerLocation).unwrap();
102102

compiler/rustc_const_eval/src/transform/promote_consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
866866

867867
let mut projection = vec![PlaceElem::Deref];
868868
projection.extend(place.projection);
869-
place.projection = tcx.mk_place_elems(&projection);
869+
place.projection = tcx.mk().place_elems(&projection);
870870

871871
// Create a temp to hold the promoted reference.
872872
// This is because `*r` requires `r` to be a local,

compiler/rustc_const_eval/src/transform/validate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
326326
}
327327
}
328328
ProjectionElem::Field(f, ty) => {
329-
let parent = Place { local, projection: self.tcx.mk_place_elems(proj_base) };
329+
let parent = Place { local, projection: self.tcx.mk().place_elems(proj_base) };
330330
let parent_ty = parent.ty(&self.body.local_decls, self.tcx);
331331
let fail_out_of_bounds = |this: &Self, location| {
332332
this.fail(location, format!("Out of bounds field {:?} for {:?}", f, parent_ty));

compiler/rustc_hir_analysis/src/astconv/generics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ pub fn create_substs_for_generic_args<'tcx, 'a>(
369369
}
370370
}
371371

372-
tcx.mk_substs(&substs)
372+
tcx.mk().substs(&substs)
373373
}
374374

375375
/// Checks that the correct number of generic arguments have been provided.

compiler/rustc_hir_analysis/src/astconv/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
381381
// here and so associated type bindings will be handled regardless of whether there are any
382382
// non-`Self` generic parameters.
383383
if generics.params.is_empty() {
384-
return (tcx.mk_substs(parent_substs), arg_count);
384+
return (tcx.mk().substs(parent_substs), arg_count);
385385
}
386386

387387
struct SubstsForAstPathCtxt<'a, 'tcx> {
@@ -1528,7 +1528,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
15281528
arg
15291529
})
15301530
.collect();
1531-
let substs = tcx.mk_substs(&substs);
1531+
let substs = tcx.mk().substs(&substs);
15321532

15331533
let span = i.bottom().1;
15341534
let empty_generic_args = hir_trait_bounds.iter().any(|hir_bound| {
@@ -1590,7 +1590,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
15901590
arg
15911591
})
15921592
.collect();
1593-
b.projection_ty.substs = tcx.mk_substs(&substs);
1593+
b.projection_ty.substs = tcx.mk().substs(&substs);
15941594
}
15951595

15961596
ty::ExistentialProjection::erase_self_ty(tcx, b)

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,8 +1947,8 @@ pub(super) fn check_type_bounds<'tcx>(
19471947
.into()
19481948
}
19491949
});
1950-
let bound_vars = tcx.mk_bound_variable_kinds(&bound_vars);
1951-
let impl_ty_substs = tcx.mk_substs(&substs);
1950+
let bound_vars = tcx.mk().bound_variable_kinds(&bound_vars);
1951+
let impl_ty_substs = tcx.mk().substs(&substs);
19521952
let container_id = impl_ty.container_id(tcx);
19531953

19541954
let rebased_substs = impl_ty_substs.rebase_onto(tcx, container_id, impl_trait_ref.substs);

compiler/rustc_hir_analysis/src/check/intrinsic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
137137
let intrinsic_name = tcx.item_name(intrinsic_id);
138138
let name_str = intrinsic_name.as_str();
139139

140-
let bound_vars = tcx.mk_bound_variable_kinds(&[
140+
let bound_vars = tcx.mk().bound_variable_kinds(&[
141141
ty::BoundVariableKind::Region(ty::BrAnon(0, None)),
142142
ty::BoundVariableKind::Region(ty::BrEnv),
143143
]);
@@ -376,7 +376,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
376376
(
377377
1,
378378
vec![tcx.mk().imm_ref(tcx.mk().re_late_bound(ty::INNERMOST, br), param(0))],
379-
tcx.mk().projection(discriminant_def_id, tcx.mk_substs(&[param(0).into()])),
379+
tcx.mk().projection(discriminant_def_id, tcx.mk().substs(&[param(0).into()])),
380380
)
381381
}
382382

compiler/rustc_hir_typeck/src/generator_interior/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ pub fn resolve_interior<'a, 'tcx>(
312312

313313
// Extract type components to build the witness type.
314314
let type_list = fcx.tcx.mk().type_list_from_iter(type_causes.iter().map(|cause| cause.ty));
315-
let bound_vars = fcx.tcx.mk_bound_variable_kinds(&bound_vars);
315+
let bound_vars = fcx.tcx.mk().bound_variable_kinds(&bound_vars);
316316
let witness =
317317
fcx.tcx.mk().generator_witness(ty::Binder::bind_with_vars(type_list, bound_vars.clone()));
318318

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
601601
debug_assert!(!out_value.needs_infer() && !out_value.has_placeholders());
602602

603603
let canonical_variables =
604-
tcx.mk_canonical_var_infos(&canonicalizer.universe_canonicalized_variables());
604+
tcx.mk().canonical_var_infos(&canonicalizer.universe_canonicalized_variables());
605605

606606
let max_universe = canonical_variables
607607
.iter()

compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
924924
) -> Option<()> {
925925
// FIXME/HACK: Go back to `SubstsRef` to use its inherent methods,
926926
// ideally that shouldn't be necessary.
927-
let sub = self.tcx.mk_substs(sub);
927+
let sub = self.tcx.mk().substs(sub);
928928
for (i, ta) in sub.types().enumerate() {
929929
if ta == other_ty {
930930
self.highlight_outer(&mut t1_out, &mut t2_out, path, sub, i, other_ty);

compiler/rustc_middle/src/infer/canonical.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl<'tcx> ty::TypeFoldable<TyCtxt<'tcx>> for CanonicalVarInfos<'tcx> {
4747
self,
4848
folder: &mut F,
4949
) -> Result<Self, F::Error> {
50-
ty::util::fold_list(self, folder, |tcx, v| tcx.mk_canonical_var_infos(v))
50+
ty::util::fold_list(self, folder, |tcx, v| tcx.mk().canonical_var_infos(v))
5151
}
5252
}
5353

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ impl<'tcx> Place<'tcx> {
16231623
&v
16241624
};
16251625

1626-
Place { local: self.local, projection: tcx.mk_place_elems(new_projections) }
1626+
Place { local: self.local, projection: tcx.mk().place_elems(new_projections) }
16271627
}
16281628
}
16291629

compiler/rustc_middle/src/mir/type_foldable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx ty::List<PlaceElem<'tcx>> {
5353
self,
5454
folder: &mut F,
5555
) -> Result<Self, F::Error> {
56-
ty::util::fold_list(self, folder, |tcx, v| tcx.mk_place_elems(v))
56+
ty::util::fold_list(self, folder, |tcx, v| tcx.mk().place_elems(v))
5757
}
5858
}

compiler/rustc_middle/src/mir/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ macro_rules! visit_place_fns {
10381038
self.visit_local(&mut place.local, context, location);
10391039

10401040
if let Some(new_projection) = self.process_projection(&place.projection, location) {
1041-
place.projection = self.tcx().mk_place_elems(&new_projection);
1041+
place.projection = self.tcx().mk().place_elems(&new_projection);
10421042
}
10431043
}
10441044

compiler/rustc_middle/src/traits/solve.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,20 @@ impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ExternalConstraints<'tcx> {
128128
self,
129129
folder: &mut F,
130130
) -> Result<Self, F::Error> {
131-
Ok(FallibleTypeFolder::interner(folder).mk_external_constraints(ExternalConstraintsData {
132-
region_constraints: self.region_constraints.clone().try_fold_with(folder)?,
133-
opaque_types: self
134-
.opaque_types
135-
.iter()
136-
.map(|opaque| opaque.try_fold_with(folder))
137-
.collect::<Result<_, F::Error>>()?,
138-
}))
131+
Ok(FallibleTypeFolder::interner(folder).mk().external_constraints(
132+
ExternalConstraintsData {
133+
region_constraints: self.region_constraints.clone().try_fold_with(folder)?,
134+
opaque_types: self
135+
.opaque_types
136+
.iter()
137+
.map(|opaque| opaque.try_fold_with(folder))
138+
.collect::<Result<_, F::Error>>()?,
139+
},
140+
))
139141
}
140142

141143
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, folder: &mut F) -> Self {
142-
TypeFolder::interner(folder).mk_external_constraints(ExternalConstraintsData {
144+
TypeFolder::interner(folder).mk().external_constraints(ExternalConstraintsData {
143145
region_constraints: self.region_constraints.clone().fold_with(folder),
144146
opaque_types: self.opaque_types.iter().map(|opaque| opaque.fold_with(folder)).collect(),
145147
})

compiler/rustc_middle/src/ty/codec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,13 @@ impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> RefDecodable<'tcx, D> for [ty::ValTre
345345

346346
impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> Decodable<D> for ConstAllocation<'tcx> {
347347
fn decode(decoder: &mut D) -> Self {
348-
decoder.interner().mk_const_alloc(Decodable::decode(decoder))
348+
decoder.interner().mk().const_alloc(Decodable::decode(decoder))
349349
}
350350
}
351351

352352
impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> Decodable<D> for AdtDef<'tcx> {
353353
fn decode(decoder: &mut D) -> Self {
354-
decoder.interner().mk_adt_def_from_data(Decodable::decode(decoder))
354+
decoder.interner().mk().adt_def_from_data(Decodable::decode(decoder))
355355
}
356356
}
357357

compiler/rustc_middle/src/ty/context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ impl<'tcx> TyCtxt<'tcx> {
636636
pub fn allocate_bytes(self, bytes: &[u8]) -> interpret::AllocId {
637637
// Create an allocation that just contains these bytes.
638638
let alloc = interpret::Allocation::from_bytes_byte_aligned_immutable(bytes);
639-
let alloc = self.mk_const_alloc(alloc);
639+
let alloc = self.mk().const_alloc(alloc);
640640
self.create_memory_alloc(alloc)
641641
}
642642

@@ -1204,7 +1204,7 @@ impl<'tcx> TyCtxt<'tcx> {
12041204
self.mk().imm_ref(
12051205
self.lifetimes.re_static,
12061206
self.type_of(self.require_lang_item(LangItem::PanicLocation, None))
1207-
.subst(self, self.mk_substs(&[self.lifetimes.re_static.into()])),
1207+
.subst(self, self.mk().substs(&[self.lifetimes.re_static.into()])),
12081208
)
12091209
}
12101210

@@ -2472,7 +2472,7 @@ impl<'tcx> TyCtxt<'tcx> {
24722472
}
24732473

24742474
pub fn late_bound_vars(self, id: HirId) -> &'tcx List<ty::BoundVariableKind> {
2475-
self.mk_bound_variable_kinds(
2475+
self.mk().bound_variable_kinds(
24762476
&self
24772477
.late_bound_vars_map(id.owner)
24782478
.and_then(|map| map.get(&id.local_id).cloned())

compiler/rustc_middle/src/ty/instance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ impl<'tcx> Instance<'tcx> {
540540

541541
pub fn resolve_drop_in_place(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> ty::Instance<'tcx> {
542542
let def_id = tcx.require_lang_item(LangItem::DropInPlace, None);
543-
let substs = tcx.mk_substs(&[ty.into()]);
543+
let substs = tcx.mk().substs(&[ty.into()]);
544544
Instance::expect_resolve(tcx, ty::ParamEnv::reveal_all(), def_id, substs)
545545
}
546546

compiler/rustc_middle/src/ty/layout.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ where
632632
ty::Adt(def, _) => def.variant(variant_index).fields.len(),
633633
_ => bug!(),
634634
};
635-
tcx.mk_layout(LayoutS {
635+
tcx.mk().layout(LayoutS {
636636
variants: Variants::Single { index: variant_index },
637637
fields: match NonZeroUsize::new(fields) {
638638
Some(fields) => FieldsShape::Union(fields),
@@ -645,7 +645,7 @@ where
645645
})
646646
}
647647

648-
Variants::Multiple { ref variants, .. } => cx.tcx().mk_layout(variants[variant_index].clone()),
648+
Variants::Multiple { ref variants, .. } => cx.tcx().mk().layout(variants[variant_index].clone()),
649649
};
650650

651651
assert_eq!(*layout.variants(), Variants::Single { index: variant_index });
@@ -667,7 +667,7 @@ where
667667
let tcx = cx.tcx();
668668
let tag_layout = |tag: Scalar| -> TyAndLayout<'tcx> {
669669
TyAndLayout {
670-
layout: tcx.mk_layout(LayoutS::scalar(cx, tag)),
670+
layout: tcx.mk().layout(LayoutS::scalar(cx, tag)),
671671
ty: tag.primitive().to_ty(tcx),
672672
}
673673
};

compiler/rustc_middle/src/ty/relate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ pub fn super_relate_consts<'tcx, R: TypeRelation<'tcx>>(
677677
for (a_arg, b_arg) in aa.iter().zip(ba.iter()) {
678678
related_args.push(r.consts(a_arg, b_arg)?);
679679
}
680-
let related_args = tcx.mk_const_list(&related_args);
680+
let related_args = tcx.mk().const_list(&related_args);
681681
Expr::FunctionCall(func, related_args)
682682
}
683683
_ => return Err(TypeError::ConstMismatch(expected_found(r, a, b))),

compiler/rustc_middle/src/ty/structural_impls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx ty::List<ty::Const<'tcx>> {
440440
self,
441441
folder: &mut F,
442442
) -> Result<Self, F::Error> {
443-
ty::util::fold_list(self, folder, |tcx, v| tcx.mk_const_list(v))
443+
ty::util::fold_list(self, folder, |tcx, v| tcx.mk().const_list(v))
444444
}
445445
}
446446

@@ -449,7 +449,7 @@ impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for &'tcx ty::List<ProjectionKind> {
449449
self,
450450
folder: &mut F,
451451
) -> Result<Self, F::Error> {
452-
ty::util::fold_list(self, folder, |tcx, v| tcx.mk_projs(v))
452+
ty::util::fold_list(self, folder, |tcx, v| tcx.mk().projs(v))
453453
}
454454
}
455455

0 commit comments

Comments
 (0)