Fix up size asserts.
- Put them in the module that defines the type. - Add some `WithCachedTypeInfo<T>` asserts for consistency.
This commit is contained in:
parent
cf95e45ec6
commit
7aec38b6d9
4 changed files with 26 additions and 14 deletions
|
|
@ -2238,15 +2238,3 @@ pub struct DestructuredConst<'tcx> {
|
|||
pub variant: Option<VariantIdx>,
|
||||
pub fields: &'tcx [ty::Const<'tcx>],
|
||||
}
|
||||
|
||||
// Some types are used a lot. Make sure they don't unintentionally get bigger.
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
mod size_asserts {
|
||||
use rustc_data_structures::static_assert_size;
|
||||
|
||||
use super::*;
|
||||
// tidy-alphabetical-start
|
||||
static_assert_size!(PredicateKind<'_>, 32);
|
||||
static_assert_size!(WithCachedTypeInfo<TyKind<'_>>, 48);
|
||||
// tidy-alphabetical-end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -704,3 +704,15 @@ impl<'tcx> Predicate<'tcx> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Some types are used a lot. Make sure they don't unintentionally get bigger.
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
mod size_asserts {
|
||||
use rustc_data_structures::static_assert_size;
|
||||
|
||||
use super::*;
|
||||
// tidy-alphabetical-start
|
||||
static_assert_size!(PredicateKind<'_>, 32);
|
||||
static_assert_size!(WithCachedTypeInfo<PredicateKind<'_>>, 56);
|
||||
// tidy-alphabetical-end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -495,3 +495,15 @@ impl BoundRegionKind {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Some types are used a lot. Make sure they don't unintentionally get bigger.
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
mod size_asserts {
|
||||
use rustc_data_structures::static_assert_size;
|
||||
|
||||
use super::*;
|
||||
// tidy-alphabetical-start
|
||||
static_assert_size!(RegionKind<'_>, 20);
|
||||
static_assert_size!(ty::WithCachedTypeInfo<RegionKind<'_>>, 48);
|
||||
// tidy-alphabetical-end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2040,7 +2040,7 @@ mod size_asserts {
|
|||
|
||||
use super::*;
|
||||
// tidy-alphabetical-start
|
||||
static_assert_size!(ty::RegionKind<'_>, 20);
|
||||
static_assert_size!(ty::TyKind<'_>, 24);
|
||||
static_assert_size!(TyKind<'_>, 24);
|
||||
static_assert_size!(ty::WithCachedTypeInfo<TyKind<'_>>, 48);
|
||||
// tidy-alphabetical-end
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue