diff --git a/src/export.rs b/src/export.rs index 2f08b2678c..a0d40a93bb 100644 --- a/src/export.rs +++ b/src/export.rs @@ -1,7 +1,5 @@ //! IMPLEMENTATION DETAILS. DO NOT USE ANYTHING IN THIS MODULE -#[cfg(not(feature = "nightly"))] -use core::ptr; use core::{cell::Cell, u8}; #[cfg(armv7m)] @@ -101,11 +99,8 @@ impl MaybeUninit { #[cfg(not(feature = "nightly"))] pub fn write(&mut self, value: T) -> &mut T { - let ptr = self.inner.as_mut_ptr(); - unsafe { - ptr::write_volatile(ptr, value); - &mut *ptr - } + self.inner = core::mem::MaybeUninit::new(value); + unsafe { self.get_mut() } } }