File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1784,9 +1784,11 @@ mod prim_ref {}
1784
1784
/// unique field that doesn't have size 0 and alignment 1 (if there is such a field).
1785
1785
/// - `i32` is ABI-compatible with `NonZero<i32>`, and similar for all other integer types.
1786
1786
/// - If `T` is guaranteed to be subject to the [null pointer
1787
- /// optimization](option/index.html#representation), then `T` and `Option<T>` are ABI-compatible.
1788
- /// Furthermore, if `U` satisfies the requirements [outlined here](result/index.html#representation),
1789
- /// then `T` and `Result<T, U>` and `Result<U, T>` are all ABI-compatible.
1787
+ /// optimization](option/index.html#representation), and `E` is an enum satisfying the following
1788
+ /// requirements, then `T` and `E` are ABI-compatible. Such an enum `E` is called "option-like".
1789
+ /// - The enum `E` has exactly two variants.
1790
+ /// - One variant has exactly one field, of type `T`.
1791
+ /// - All fields of the other variant are zero-sized with 1-byte alignment.
1790
1792
///
1791
1793
/// Furthermore, ABI compatibility satisfies the following general properties:
1792
1794
///
You can’t perform that action at this time.
0 commit comments