Skip to content

Commit e729531

Browse files
committed
require that there NOT be the non_exhaustive attribute on the ZST
1 parent f647e37 commit e729531

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

text/0000-result_ffi_guarantees.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ I'm not sure how to write a "guide" portion of this that's any simpler than the
2828
When either of these two `core` types:
2929

3030
* `Option<T>`
31-
* `Result<T, E>` where either `T` or `E` are a zero-sized type with alignment 1 (a "1-ZST") and either no fields (eg: `()` or `struct Foo;`) or with `repr(transparent)` if there are fields.
31+
* `Result<T, E>` where either `T` or `E`:
32+
* Are a zero-sized type with alignment 1 (a "1-ZST").
33+
* Either have no fields (eg: `()` or `struct Foo;`) or have `repr(transparent)` if there are fields.
34+
* Do not have the `#[non_exhaustive]` attribute.
3235

3336
Is combined with a non-zero or non-null type (see the chart), the combination has the same layout (size and alignment) and the same ABI as the primitive form of the data.
3437

0 commit comments

Comments
 (0)