Skip to content

Commit 91326de

Browse files
committed
Exempt UnsafeCell from layout.repr.rust.option.candidates
1 parent 76422f1 commit 91326de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/type-layout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ The following types are *elision candidate types*:
297297
* [`alloc::boxed::Box<U>`], if `U` is a `Sized` type
298298
* [`core::num::NonZero<T>`] if `T` is an integer type
299299
* A [function pointer][type.fn-pointer] type
300-
* A `struct`, defined using [`repr(transparent)`][layout.repr.transparent], which has a field that is an *elision candidate*, and all other fields have size 0 and alignment 1.
300+
* A `struct`, other than [`core::cell::UnsafeCell<T>`], defined using [`repr(transparent)`][layout.repr.transparent], which has a field that is an *elision candidate*, and all other fields have size 0 and alignment 1.
301301

302302
r[layout.repr.rust.option.elision]
303303
If the *elision candidate field* of a *discriminant elision eligible* `enum` has an *elision candidate type*, then the `enum` has the same layout as that field, except that the value consisting of all `0` bytes represents the *elided variant* of the `enum`.

0 commit comments

Comments
 (0)