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
This commit is contained in:
Ralf Jung 2020-09-19 11:47:49 +02:00 committed by GitHub
commit 8a7cb1eac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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 {