On Thu, Mar 14, 2024 at 12:09 AM Benno Lossin benno.lossin@proton.me wrote:
From: Laine Taffin Altman alexanderaltman@me.com
It is not enough for a type to be a ZST to guarantee that zeroed memory is a valid value for it; it must also be inhabited. Creating a value of an uninhabited type, ZST or no, is immediate UB. Thus remove the implementation of `Zeroable` for `Infallible`, since that type is not inhabited.
Cc: stable@vger.kernel.org Fixes: 38cde0bd7b67 ("rust: init: add `Zeroable` trait and `init::zeroed` function") Closes: https://github.com/Rust-for-Linux/pinned-init/pull/13 Signed-off-by: Laine Taffin Altman alexanderaltman@me.com Signed-off-by: Benno Lossin benno.lossin@proton.me
Reviewed-by: Alice Ryhl aliceryhl@google.com