about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-09-19 11:47:49 +0200
committerGitHub <noreply@github.com>2020-09-19 11:47:49 +0200
commit8a7cb1eac1764da047196f7e3572fb12ca1a22d4 (patch)
treecc265c3da18929996e42bef3f722d05d4a3d83fd
parent46bb884cf3c698ed231d2521fe5a19ee0b8a5e55 (diff)
parent91f7d761e762d0d9f47cf61cf5d942fd93eaf2a8 (diff)
downloadrust-8a7cb1eac1764da047196f7e3572fb12ca1a22d4.tar.gz
rust-8a7cb1eac1764da047196f7e3572fb12ca1a22d4.zip
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
-rw-r--r--compiler/rustc_middle/src/mir/interpret/value.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/value.rs b/compiler/rustc_middle/src/mir/interpret/value.rs
index 7d6ff3eb5c1..7741c76ff3e 100644
--- a/compiler/rustc_middle/src/mir/interpret/value.rs
+++ b/compiler/rustc_middle/src/mir/interpret/value.rs
@@ -578,6 +578,9 @@ pub enum ScalarMaybeUninit<Tag = ()> {
     Uninit,
 }
 
+#[cfg(target_arch = "x86_64")]
+static_assert_size!(ScalarMaybeUninit, 24);
+
 impl<Tag> From<Scalar<Tag>> for ScalarMaybeUninit<Tag> {
     #[inline(always)]
     fn from(s: Scalar<Tag>) -> Self {