diff options
| author | Michael Benfield <mbenfield@google.com> | 2022-03-08 19:07:01 +0000 |
|---|---|---|
| committer | Michael Benfield <mbenfield@google.com> | 2022-09-07 20:12:45 +0000 |
| commit | d7a750b50436fbd228b176f6438566625e235990 (patch) | |
| tree | 4fc710101a6ad49617739201ebb72660e54b2e43 /compiler/rustc_const_eval | |
| parent | 1a08b96a0bb7c170130144214787b4a46aa5eb17 (diff) | |
Use niche-filling optimization even when multiple variants have data.
Fixes #46213
Diffstat (limited to 'compiler/rustc_const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/operand.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/place.rs | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs index efa33e18510..ba041810bd1 100644 --- a/compiler/rustc_const_eval/src/interpret/operand.rs +++ b/compiler/rustc_const_eval/src/interpret/operand.rs @@ -780,13 +780,13 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { } // Some nodes are used a lot. Make sure they don't unintentionally get bigger. -#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] +#[cfg(all(target_arch = "x86_64", target_pointer_width = "64", not(bootstrap)))] mod size_asserts { use super::*; use rustc_data_structures::static_assert_size; // These are in alphabetical order, which is easy to maintain. - static_assert_size!(Immediate, 56); - static_assert_size!(ImmTy<'_>, 72); - static_assert_size!(Operand, 64); - static_assert_size!(OpTy<'_>, 88); + static_assert_size!(Immediate, 48); + static_assert_size!(ImmTy<'_>, 64); + static_assert_size!(Operand, 56); + static_assert_size!(OpTy<'_>, 80); } diff --git a/compiler/rustc_const_eval/src/interpret/place.rs b/compiler/rustc_const_eval/src/interpret/place.rs index 81b0b5a7459..b328892906d 100644 --- a/compiler/rustc_const_eval/src/interpret/place.rs +++ b/compiler/rustc_const_eval/src/interpret/place.rs @@ -890,6 +890,8 @@ mod size_asserts { static_assert_size!(MemPlaceMeta, 24); static_assert_size!(MemPlace, 40); static_assert_size!(MPlaceTy<'_>, 64); - static_assert_size!(Place, 48); - static_assert_size!(PlaceTy<'_>, 72); + #[cfg(not(bootstrap))] + static_assert_size!(Place, 40); + #[cfg(not(bootstrap))] + static_assert_size!(PlaceTy<'_>, 64); } |
