Skip to content

Commit 7b41494

Browse files
committed
mention mitigation in the docs
1 parent 84ff4da commit 7b41494

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/mem/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ pub unsafe fn zeroed<T>() -> T {
654654
/// produce a value of type `T`, while doing nothing at all.
655655
///
656656
/// **This function is deprecated.** Use [`MaybeUninit<T>`] instead.
657+
/// It also might be slower than using `MaybeUninit<T>` due to mitigations that were put in place to
658+
/// limit the potential harm caused by incorrect use of this function in legacy code.
657659
///
658660
/// The reason for deprecation is that the function basically cannot be used
659661
/// correctly: it has the same effect as [`MaybeUninit::uninit().assume_init()`][uninit].

0 commit comments

Comments
 (0)