diff options
author | Benno Lossin <benno.lossin@proton.me> | 2023-08-14 08:47:32 +0000 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2023-08-21 14:31:49 +0200 |
commit | 2e704f1883f5dd2f1380944c7d969c817fcd189e (patch) | |
tree | a1fdc5b19b6b24890542983a3033093f8a450a84 /rust/Makefile | |
parent | 674b1c7aed6082e1ce329bb3bcb49e7eb9913e79 (diff) | |
download | lwn-2e704f1883f5dd2f1380944c7d969c817fcd189e.tar.gz lwn-2e704f1883f5dd2f1380944c7d969c817fcd189e.zip |
rust: init: implement `Zeroable` for `UnsafeCell<T>` and `Opaque<T>`
`UnsafeCell<T>` and `T` have the same layout so if `T` is `Zeroable`
then so should `UnsafeCell<T>` be. This allows using the derive macro
for `Zeroable` on types that contain an `UnsafeCell<T>`.
Since `Opaque<T>` contains a `MaybeUninit<T>`, all bytes zero is a valid
bit pattern for that type.
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230814084602.25699-11-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/Makefile')
0 files changed, 0 insertions, 0 deletions