mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-27 20:40:32 +00:00
tweak crate::MaybeUninit::unitialized
to not cause UB when unoptimized appears to fix japaric/cortex-m-rtfm#182
This commit is contained in:
parent
aab766f764
commit
6281cd359c
@ -26,7 +26,9 @@ pub mod mem {
|
||||
|
||||
#[cfg(not(feature = "const-fn"))]
|
||||
pub unsafe fn uninitialized() -> Self {
|
||||
mem::uninitialized()
|
||||
MaybeUninit {
|
||||
value: ManuallyDrop::new(mem::uninitialized()),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a reference to the contained value.
|
||||
|
Loading…
x
Reference in New Issue
Block a user