mention mitigation in the docs

This commit is contained in:
Ralf Jung 2022-07-12 11:56:35 -04:00
parent 84ff4da726
commit 7b4149474b

View File

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