Messages in this thread | | | From | Miguel Ojeda <> | Date | Thu, 10 Aug 2023 01:21:33 +0200 | Subject | Re: [PATCH] rust: make `UnsafeCell` the outer type in `Opaque` |
| |
On Wed, Jun 14, 2023 at 1:53 PM Alice Ryhl <aliceryhl@google.com> wrote: > > 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 <aliceryhl@google.com>
Applied to `rust-next`, thanks everyone!
Cheers, Miguel
| |