]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/mem/mod.rs
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / library / core / src / mem / mod.rs
index 383bdc7b6e2e9f945d008186a4574744b186a92d..5e01ccc07d8fdbf7d1b559004688fb8916311e1f 100644 (file)
@@ -682,7 +682,8 @@ pub unsafe fn zeroed<T>() -> T {
 pub unsafe fn uninitialized<T>() -> T {
     // SAFETY: the caller must guarantee that an uninitialized value is valid for `T`.
     unsafe {
-        intrinsics::assert_uninit_valid::<T>();
+        #[cfg(not(bootstrap))] // If the compiler hits this itself then it deserves the UB.
+        intrinsics::assert_mem_uninitialized_valid::<T>();
         let mut val = MaybeUninit::<T>::uninit();
 
         // Fill memory with 0x01, as an imperfect mitigation for old code that uses this function on