diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-04-06 15:35:14 +1000 |
|---|---|---|
| committer | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2023-04-07 09:15:38 -0400 |
| commit | f08f15481afbd122355a6e1223c007fc774825ad (patch) | |
| tree | 6e36779965bf3bdbf8ce0384b9e4cdf3a8f7f070 | |
| parent | b15195a304ff4404c4f67f19b5e1dc3efc587a6d (diff) | |
| download | rust-f08f15481afbd122355a6e1223c007fc774825ad.tar.gz rust-f08f15481afbd122355a6e1223c007fc774825ad.zip | |
Add a size assertion for `RegionKind`.
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index d542d93b8c8..0e2e2a956ec 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -127,10 +127,6 @@ impl<'tcx> Article for TyKind<'tcx> { } } -// `TyKind` is used a lot. Make sure it doesn't unintentionally get bigger. -#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] -static_assert_size!(TyKind<'_>, 32); - /// A closure can be modeled as a struct that looks like: /// ```ignore (illustrative) /// struct Closure<'l0...'li, T0...Tj, CK, CS, U>(...U); @@ -2496,3 +2492,14 @@ impl<'tcx> VarianceDiagInfo<'tcx> { } } } + +// Some types are used a lot. Make sure they don't unintentionally get bigger. +#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] +mod size_asserts { + use super::*; + use rustc_data_structures::static_assert_size; + // tidy-alphabetical-start + static_assert_size!(RegionKind<'_>, 28); + static_assert_size!(TyKind<'_>, 32); + // tidy-alphabetical-end +} |
