diff options
| author | Alice Ryhl <[email protected]> | 2023-06-14 11:53:28 +0000 |
|---|---|---|
| committer | Miguel Ojeda <[email protected]> | 2023-08-09 23:18:34 +0000 |
| commit | 35cad617df2eeef8440a38e82bb2d81ae32ca50d (patch) | |
| tree | c242223c7b6afcd9846da86b59d6eeccfefbcda7 /rust/helpers.c | |
| parent | kbuild: rust_is_available: add test suite (diff) | |
| download | kernel-35cad617df2eeef8440a38e82bb2d81ae32ca50d.tar.gz kernel-35cad617df2eeef8440a38e82bb2d81ae32ca50d.zip | |
rust: make `UnsafeCell` the outer type in `Opaque`
When combining `UnsafeCell` with `MaybeUninit`, it is idiomatic to use
`UnsafeCell` as the outer type. Intuitively, this is because a
`MaybeUninit<T>` might not contain a `T`, but we always want the effect
of the `UnsafeCell`, even if the inner value is uninitialized.
Now, strictly speaking, this doesn't really make a difference. The
compiler will always apply the `UnsafeCell` effect even if the inner
value is uninitialized. But I think we should follow the convention
here.
Signed-off-by: Alice Ryhl <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
Reviewed-by: Martin Rodriguez Reboredo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'rust/helpers.c')
0 files changed, 0 insertions, 0 deletions
