Skip to content

Commit

Permalink
Rollup merge of rust-lang#76636 - RalfJung:miri-size-assert, r=oli-obk
Browse files Browse the repository at this point in the history
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
  • Loading branch information
RalfJung authored Sep 19, 2020
2 parents e00725a + 91f7d76 commit d8892b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_middle/src/mir/interpret/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d8892b4

Please sign in to comment.