aboutsummaryrefslogtreecommitdiff
path: root/rust/kernel/static_assert.rs
diff options
context:
space:
mode:
authorBenno Lossin <[email protected]>2023-08-14 08:47:10 +0000
committerMiguel Ojeda <[email protected]>2023-08-21 14:31:48 +0200
commit35e7fca2ff59d9d8f036aba3dcf5c34beb79fdb8 (patch)
treefb976465a2dd8e52d3017e10e885e3dc1f976ded /rust/kernel/static_assert.rs
parent92fd540d62701115b22b1f531c8c86454809931b (diff)
rust: init: add `..Zeroable::zeroed()` syntax for zeroing all missing fields
Add the struct update syntax to the init macros, but only for `..Zeroable::zeroed()`. Adding this at the end of the struct initializer allows one to omit fields from the initializer, these fields will be initialized with 0x00 set to every byte. Only types that implement the `Zeroable` trait can utilize this. Suggested-by: Asahi Lina <[email protected]> Reviewed-by: Martin Rodriguez Reboredo <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Reviewed-by: Gary Guo <[email protected]> Signed-off-by: Benno Lossin <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Rebased on `rust-next` and cleaned a few trivial nits. ] Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'rust/kernel/static_assert.rs')
0 files changed, 0 insertions, 0 deletions