Skip to content

Commit 6d67b09

Browse files
committed
Remove last mk_* methods from TyCtxt
1 parent 959acfc commit 6d67b09

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

compiler/rustc_middle/src/ty/context.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,15 +1524,13 @@ macro_rules! direct_interners {
15241524
// Functions with a `mk_` prefix are intended for use outside this file and
15251525
// crate. Functions with an `intern_` prefix are intended for use within this
15261526
// file only, and have a corresponding `mk_` function.
1527-
//
1528-
// TODO(waffle): pub mk_* -> intern_*
15291527
direct_interners! {
15301528
region: intern_region(RegionKind<'tcx>): Region -> Region<'tcx>,
15311529
const_: intern_const(ConstData<'tcx>): Const -> Const<'tcx>,
1532-
const_allocation: pub mk_const_alloc(Allocation): ConstAllocation -> ConstAllocation<'tcx>,
1533-
layout: pub mk_layout(LayoutS): Layout -> Layout<'tcx>,
1534-
adt_def: pub mk_adt_def_from_data(AdtDefData): AdtDef -> AdtDef<'tcx>,
1535-
external_constraints: pub mk_external_constraints(ExternalConstraintsData<'tcx>):
1530+
const_allocation: intern_const_alloc(Allocation): ConstAllocation -> ConstAllocation<'tcx>,
1531+
layout: intern_layout(LayoutS): Layout -> Layout<'tcx>,
1532+
adt_def: intern_adt_def_from_data(AdtDefData): AdtDef -> AdtDef<'tcx>,
1533+
external_constraints: intern_external_constraints(ExternalConstraintsData<'tcx>):
15361534
ExternalConstraints -> ExternalConstraints<'tcx>,
15371535
}
15381536

@@ -1555,16 +1553,15 @@ macro_rules! slice_interners {
15551553
// These functions intern slices. They all have a corresponding
15561554
// `mk_foo_from_iter` function that interns an iterator. The slice version
15571555
// should be used when possible, because it's faster.
1558-
// TODO: deprecate/make into private `intern_*`/etc all `mk_*` methods here
15591556
slice_interners!(
1560-
const_lists: pub mk_const_list(Const<'tcx>),
1561-
substs: pub mk_substs(GenericArg<'tcx>),
1562-
canonical_var_infos: pub mk_canonical_var_infos(CanonicalVarInfo<'tcx>),
1557+
const_lists: intern_const_list(Const<'tcx>),
1558+
substs: intern_substs(GenericArg<'tcx>),
1559+
canonical_var_infos: intern_canonical_var_infos(CanonicalVarInfo<'tcx>),
15631560
poly_existential_predicates: intern_poly_existential_predicates(PolyExistentialPredicate<'tcx>),
15641561
predicates: intern_predicates(Predicate<'tcx>),
1565-
projs: pub mk_projs(ProjectionKind),
1566-
place_elems: pub mk_place_elems(PlaceElem<'tcx>),
1567-
bound_variable_kinds: pub mk_bound_variable_kinds(ty::BoundVariableKind),
1562+
projs: intern_projs(ProjectionKind),
1563+
place_elems: intern_place_elems(PlaceElem<'tcx>),
1564+
bound_variable_kinds: intern_bound_variable_kinds(ty::BoundVariableKind),
15681565
);
15691566

15701567
impl<'tcx> TyCtxt<'tcx> {

compiler/rustc_middle/src/ty/context/mk.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -692,60 +692,60 @@ impl<'tcx> MkCtxt<'tcx> {
692692

693693
#[inline]
694694
pub fn const_list(self, v: &[Const<'tcx>]) -> &'tcx List<Const<'tcx>> {
695-
self.tcx.mk_const_list(v)
695+
self.tcx.intern_const_list(v)
696696
}
697697

698698
#[inline]
699699
pub fn substs(self, v: &[GenericArg<'tcx>]) -> &'tcx List<GenericArg<'tcx>> {
700-
self.tcx.mk_substs(v)
700+
self.tcx.intern_substs(v)
701701
}
702702

703703
#[inline]
704704
pub fn canonical_var_infos(
705705
self,
706706
v: &[CanonicalVarInfo<'tcx>],
707707
) -> &'tcx List<CanonicalVarInfo<'tcx>> {
708-
self.tcx.mk_canonical_var_infos(v)
708+
self.tcx.intern_canonical_var_infos(v)
709709
}
710710

711711
#[inline]
712712
pub fn projs(self, v: &[ProjectionKind]) -> &'tcx List<ProjectionKind> {
713-
self.tcx.mk_projs(v)
713+
self.tcx.intern_projs(v)
714714
}
715715

716716
#[inline]
717717
pub fn place_elems(self, v: &[PlaceElem<'tcx>]) -> &'tcx List<PlaceElem<'tcx>> {
718-
self.tcx.mk_place_elems(v)
718+
self.tcx.intern_place_elems(v)
719719
}
720720

721721
#[inline]
722722
pub fn bound_variable_kinds(
723723
self,
724724
v: &[ty::BoundVariableKind],
725725
) -> &'tcx List<ty::BoundVariableKind> {
726-
self.tcx.mk_bound_variable_kinds(v)
726+
self.tcx.intern_bound_variable_kinds(v)
727727
}
728728

729729
#[inline]
730730
pub fn const_alloc(self, v: Allocation) -> ConstAllocation<'tcx> {
731-
self.tcx.mk_const_alloc(v)
731+
self.tcx.intern_const_alloc(v)
732732
}
733733

734734
#[inline]
735735
pub fn layout(self, v: LayoutS) -> Layout<'tcx> {
736-
self.tcx.mk_layout(v)
736+
self.tcx.intern_layout(v)
737737
}
738738

739739
#[inline]
740740
pub fn adt_def_from_data(self, v: AdtDefData) -> AdtDef<'tcx> {
741-
self.tcx.mk_adt_def_from_data(v)
741+
self.tcx.intern_adt_def_from_data(v)
742742
}
743743

744744
#[inline]
745745
pub fn external_constraints(
746746
self,
747747
v: ExternalConstraintsData<'tcx>,
748748
) -> ExternalConstraints<'tcx> {
749-
self.tcx.mk_external_constraints(v)
749+
self.tcx.intern_external_constraints(v)
750750
}
751751
}

0 commit comments

Comments
 (0)