Skip to content

Commit 8a7cb1e

Browse files
authored
Rollup merge of #76636 - RalfJung:miri-size-assert, r=oli-obk
assert ScalarMaybeUninit size I noticed most low-level Miri types have such an assert but `ScalarMaybeUninit` does not, so let's add that. Good t see that the `Option`-like optimization kicks in and this is no bigger than `Scalar`. :) r? @oli-obk
2 parents 46bb884 + 91f7d76 commit 8a7cb1e

File tree

1 file changed

+3
-0
lines changed
  • compiler/rustc_middle/src/mir/interpret

1 file changed

+3
-0
lines changed

compiler/rustc_middle/src/mir/interpret/value.rs

+3
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,9 @@ pub enum ScalarMaybeUninit<Tag = ()> {
578578
Uninit,
579579
}
580580

581+
#[cfg(target_arch = "x86_64")]
582+
static_assert_size!(ScalarMaybeUninit, 24);
583+
581584
impl<Tag> From<Scalar<Tag>> for ScalarMaybeUninit<Tag> {
582585
#[inline(always)]
583586
fn from(s: Scalar<Tag>) -> Self {

0 commit comments

Comments
 (0)