Skip to content

Commit f647045

Browse files
committed
Rename ConstS to ConstData
1 parent 08f38c4 commit f647045

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

compiler/rustc_middle/src/arena.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ macro_rules! arena_types {
9090
// Interned types
9191
[] tys: rustc_data_structures::intern::WithStableHash<rustc_middle::ty::TyS<'tcx>>,
9292
[] predicates: rustc_middle::ty::PredicateS<'tcx>,
93-
[] consts: rustc_middle::ty::ConstS<'tcx>,
93+
[] consts: rustc_middle::ty::ConstData<'tcx>,
9494

9595
// Note that this deliberately duplicates items in the `rustc_hir::arena`,
9696
// since we need to allocate this type on both the `rustc_hir` arena

compiler/rustc_middle/src/ty/codec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> RefDecodable<'tcx, D>
310310

311311
impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> Decodable<D> for ty::Const<'tcx> {
312312
fn decode(decoder: &mut D) -> Self {
313-
let consts: ty::ConstS<'tcx> = Decodable::decode(decoder);
313+
let consts: ty::ConstData<'tcx> = Decodable::decode(decoder);
314314
decoder.interner().mk_const(consts.kind, consts.ty)
315315
}
316316
}

compiler/rustc_middle/src/ty/consts.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ pub use valtree::*;
1717
/// Use this rather than `ConstS`, whenever possible.
1818
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable)]
1919
#[rustc_pass_by_value]
20-
pub struct Const<'tcx>(pub Interned<'tcx, ConstS<'tcx>>);
20+
pub struct Const<'tcx>(pub Interned<'tcx, ConstData<'tcx>>);
2121

2222
impl<'tcx> std::ops::Deref for Const<'tcx> {
23-
type Target = ConstS<'tcx>;
23+
type Target = ConstData<'tcx>;
2424

2525
fn deref(&self) -> &Self::Target {
2626
&self.0.0
@@ -38,13 +38,13 @@ impl<'tcx> fmt::Debug for Const<'tcx> {
3838

3939
/// Typed constant value.
4040
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, HashStable, TyEncodable, TyDecodable)]
41-
pub struct ConstS<'tcx> {
41+
pub struct ConstData<'tcx> {
4242
pub ty: Ty<'tcx>,
4343
pub kind: ConstKind<'tcx>,
4444
}
4545

4646
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
47-
static_assert_size!(ConstS<'_>, 40);
47+
static_assert_size!(ConstData<'_>, 40);
4848

4949
impl<'tcx> Const<'tcx> {
5050
/// Literals and const generic parameters are eagerly converted to a constant, everything else

compiler/rustc_middle/src/ty/context.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::traits;
1717
use crate::ty::query::{self, TyCtxtAt};
1818
use crate::ty::{
1919
self, AdtDef, AdtDefData, AdtKind, Binder, BindingMode, BoundVar, CanonicalPolyFnSig,
20-
ClosureSizeProfileData, Const, ConstS, ConstVid, DefIdTree, FloatTy, FloatVar, FloatVid,
20+
ClosureSizeProfileData, Const, ConstData, ConstVid, DefIdTree, FloatTy, FloatVar, FloatVid,
2121
GenericParamDefKind, InferConst, InferTy, IntTy, IntVar, IntVid, List, ParamConst, ParamTy,
2222
PolyExistentialPredicate, PolyFnSig, Predicate, PredicateKind, PredicateS, ProjectionTy,
2323
Region, RegionKind, ReprOptions, TraitObjectVisitor, Ty, TyKind, TyS, TyVar, TyVid, TypeAndMut,
@@ -145,7 +145,7 @@ pub struct CtxtInterners<'tcx> {
145145
predicates: InternedSet<'tcx, List<Predicate<'tcx>>>,
146146
projs: InternedSet<'tcx, List<ProjectionKind>>,
147147
place_elems: InternedSet<'tcx, List<PlaceElem<'tcx>>>,
148-
const_: InternedSet<'tcx, ConstS<'tcx>>,
148+
const_: InternedSet<'tcx, ConstData<'tcx>>,
149149
const_allocation: InternedSet<'tcx, Allocation>,
150150
bound_variable_kinds: InternedSet<'tcx, List<ty::BoundVariableKind>>,
151151
layout: InternedSet<'tcx, LayoutS<VariantIdx>>,
@@ -985,7 +985,7 @@ impl<'tcx> CommonConsts<'tcx> {
985985
};
986986

987987
CommonConsts {
988-
unit: mk_const(ty::ConstS {
988+
unit: mk_const(ty::ConstData {
989989
kind: ty::ConstKind::Value(ty::ValTree::zst()),
990990
ty: types.unit,
991991
}),
@@ -2242,7 +2242,7 @@ macro_rules! direct_interners {
22422242

22432243
direct_interners! {
22442244
region: mk_region(RegionKind<'tcx>): Region -> Region<'tcx>,
2245-
const_: mk_const_internal(ConstS<'tcx>): Const -> Const<'tcx>,
2245+
const_: mk_const_internal(ConstData<'tcx>): Const -> Const<'tcx>,
22462246
const_allocation: intern_const_alloc(Allocation): ConstAllocation -> ConstAllocation<'tcx>,
22472247
layout: intern_layout(LayoutS<VariantIdx>): Layout -> Layout<'tcx>,
22482248
adt_def: intern_adt_def(AdtDefData): AdtDef -> AdtDef<'tcx>,
@@ -2592,7 +2592,7 @@ impl<'tcx> TyCtxt<'tcx> {
25922592

25932593
#[inline]
25942594
pub fn mk_const(self, kind: ty::ConstKind<'tcx>, ty: Ty<'tcx>) -> Const<'tcx> {
2595-
self.mk_const_internal(ty::ConstS { kind, ty })
2595+
self.mk_const_internal(ty::ConstData { kind, ty })
25962596
}
25972597

25982598
#[inline]

compiler/rustc_middle/src/ty/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub use self::closure::{
7777
CAPTURE_STRUCT_LOCAL,
7878
};
7979
pub use self::consts::{
80-
Const, ConstInt, ConstKind, ConstS, InferConst, ScalarInt, UnevaluatedConst, ValTree,
80+
Const, ConstData, ConstInt, ConstKind, InferConst, ScalarInt, UnevaluatedConst, ValTree,
8181
};
8282
pub use self::context::{
8383
tls, CanonicalUserType, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations,
@@ -1017,7 +1017,7 @@ impl<'tcx> Term<'tcx> {
10171017
&*((ptr & !TAG_MASK) as *const WithStableHash<ty::TyS<'tcx>>),
10181018
))),
10191019
CONST_TAG => TermKind::Const(ty::Const(Interned::new_unchecked(
1020-
&*((ptr & !TAG_MASK) as *const ty::ConstS<'tcx>),
1020+
&*((ptr & !TAG_MASK) as *const ty::ConstData<'tcx>),
10211021
))),
10221022
_ => core::intrinsics::unreachable(),
10231023
}
@@ -1063,7 +1063,7 @@ impl<'tcx> TermKind<'tcx> {
10631063
TermKind::Const(ct) => {
10641064
// Ensure we can use the tag bits.
10651065
assert_eq!(mem::align_of_val(&*ct.0.0) & TAG_MASK, 0);
1066-
(CONST_TAG, ct.0.0 as *const ty::ConstS<'tcx> as usize)
1066+
(CONST_TAG, ct.0.0 as *const ty::ConstData<'tcx> as usize)
10671067
}
10681068
};
10691069

compiler/rustc_middle/src/ty/subst.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<'tcx> GenericArgKind<'tcx> {
8989
GenericArgKind::Const(ct) => {
9090
// Ensure we can use the tag bits.
9191
assert_eq!(mem::align_of_val(&*ct.0.0) & TAG_MASK, 0);
92-
(CONST_TAG, ct.0.0 as *const ty::ConstS<'tcx> as usize)
92+
(CONST_TAG, ct.0.0 as *const ty::ConstData<'tcx> as usize)
9393
}
9494
};
9595

@@ -156,7 +156,7 @@ impl<'tcx> GenericArg<'tcx> {
156156
&*((ptr & !TAG_MASK) as *const WithStableHash<ty::TyS<'tcx>>),
157157
))),
158158
CONST_TAG => GenericArgKind::Const(ty::Const(Interned::new_unchecked(
159-
&*((ptr & !TAG_MASK) as *const ty::ConstS<'tcx>),
159+
&*((ptr & !TAG_MASK) as *const ty::ConstData<'tcx>),
160160
))),
161161
_ => intrinsics::unreachable(),
162162
}

0 commit comments

Comments
 (0)