@@ -1544,28 +1544,35 @@ mod prim_ref {}
15441544///
15451545/// The following types are guaranteed to be ABI-compatible:
15461546///
1547- /// - Every type is ABI-compatible with itself.
15481547/// - `*const T`, `*mut T`, `&T`, `&mut T`, `Box<T>`, `NonNull<T>` are all ABI-compatible with each
15491548/// other for all `T`.
1550- /// - Any two `fn()` types with the same `extern` ABI string are ABI-compatible with each other.
1551- /// - Any two 1-ZST types (types with size 0 and alignment 1) are ABI-compatible.
1552- /// - A `repr(transparent)` type `T` is ABI-compatible with its unique non-1-ZST field (if there is
1553- /// such a field).
1549+ /// - Any two `fn`/`extern "ABI" fn` types with the same call ABI are ABI-compatible with each
1550+ /// other, independent of the rest of their signature.
1551+ /// - Any two types with size 0 and alignment 1 are ABI-compatible.
1552+ /// - A `repr(transparent)` type `T` is ABI-compatible with its unique non-trivial field, i.e., the
1553+ /// unique field that doesn't have size 0 and alignment 1 (if there is such a field).
15541554/// - `i32` is ABI-compatible with `NonZeroI32`, and similar for all other integer types with their
15551555/// matching `NonZero*` type.
15561556/// - If `T` is guaranteed to be subject to the [null pointer
15571557/// optimization](option/index.html#representation), then `T` and `Option<T>` are ABI-compatible.
1558+ ///
1559+ /// Furthermore, ABI compatibility satisfies the following general properties:
1560+ ///
1561+ /// - Every type is ABI-compatible with itself.
15581562/// - If `T1` and `T2` are ABI-compatible, then two `repr(C)` types that only differ because one
15591563/// field type was changed from `T1` to `T2` are ABI-compatible.
1560- /// - ABI-compatibility is symmetric and transitive.
1564+ /// - If `T1` and `T2` are ABI-compatible and `T2` and `T3` are ABI-compatible, then so are `T1` and
1565+ /// `T3` (i.e., ABI-compatibility is transitive).
1566+ /// - If `T1` and `T2` are ABI-compatible, then so are `T2` and `T1` (i.e., ABI-compatibility is
1567+ /// symmetric).
15611568///
15621569/// More signatures can be ABI-compatible on specific targets, but that should not be relied upon
15631570/// since it is not portable and not a stable guarantee.
15641571///
15651572/// Noteworthy cases of types *not* being ABI-compatible in general are `bool` vs `u8`, and `i32` vs
15661573/// `u32`: on some targets, the calling conventions for these types differ in terms of what they
15671574/// guarantee for the remaining bits in the register that are not used by the value. `i32` vs `f32`
1568- /// has already been mentioned above.
1575+ /// are not compatible either, as has already been mentioned above.
15691576///
15701577/// Note that these rules describe when two completely known types are ABI-compatible. When
15711578/// considering ABI compatibility of a type declared in another crate (including the standard
0 commit comments