From 5c4c48274012b606435d73c352bb6306a8fd3ad7 Mon Sep 17 00:00:00 2001 From: coolreader18 <33094578+coolreader18@users.noreply.github.com> Date: Wed, 22 Jan 2020 22:50:02 -0600 Subject: [PATCH] Tweak partially_init macro --- vm/src/types.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vm/src/types.rs b/vm/src/types.rs index 7c44184f7..2a8722fd8 100644 --- a/vm/src/types.rs +++ b/vm/src/types.rs @@ -245,13 +245,13 @@ macro_rules! partially_init { Uninit { $($uninit_field:ident),*$(,)? }$(,)? ) => {{ // check all the fields are there but *don't* actually run it - #[allow(deprecated, invalid_value)] - {if false { + if false { + #[allow(invalid_value)] let _ = {$ty { $($init_field: $init_value,)* - $($uninit_field: ::std::mem::uninitialized(),)* + $($uninit_field: ::std::mem::MaybeUninit::uninit().assume_init(),)* }}; - }} + } let mut m = ::std::mem::MaybeUninit::<$ty>::uninit(); $(::std::ptr::write(&mut (*m.as_mut_ptr()).$init_field, $init_value);)* m