@@ -1537,18 +1537,18 @@ mod prim_ref {}
1537
1537
///
1538
1538
/// The following types are guaranteed to be ABI-compatible:
1539
1539
///
1540
- /// - `*const T`, `*mut T`, `&T`, `&mut T`, `Box<T>` (specifically, only `Box<T, Global>`),
1541
- /// `NonNull<T>` are all ABI-compatible with each other for all `T`. Two of these pointer types
1542
- /// with different `T` are ABI-compatible if they have the same metadata type (`<T as
1540
+ /// - `*const T`, `*mut T`, `&T`, `&mut T`, `Box<T>` (specifically, only `Box<T, Global>`), and
1541
+ /// `NonNull<T>` are all ABI-compatible with each other for all `T`. They are also ABI-compatible
1542
+ /// with with each other for _different_ `T` if they have the same metadata type (`<T as
1543
1543
/// Pointee>::Metadata`).
1544
1544
/// - `usize` is ABI-compatible with the `uN` integer type of the same size, and likewise `isize` is
1545
1545
/// ABI-compatible with the `iN` integer type of the same size.
1546
- /// - Any two `fn` types are ABI-compatible with each other if they have the same ABI string or the
1547
- /// ABI string only differs in a trailing `-unwind`, independent of the rest of their signature.
1548
- /// (Note that this is about the case of passing a function pointer as an argument to a function.
1549
- /// The two pointers being ABI-compatible here means that the call successfully passes the
1550
- /// pointer. When actually calling the pointer, of course the rest of the signature becomes
1551
- /// relevant as well, according to the rules in this section .)
1546
+ /// - Any two `fn` (function pointer) types are ABI-compatible with each other if they have the same
1547
+ /// ABI string or the ABI string only differs in a trailing `-unwind`, independent of the rest of
1548
+ /// their signature. (This means you can pass `fn()` to a function expecting `fn(i32)`, and the
1549
+ /// call will be valid ABI-wise. The callee receives the result of transmuting the function pointer
1550
+ /// from `fn()` to `fn(i32)`; that transmutation is itself a well-defined operation, it's just
1551
+ /// almost certainly UB to later call that function pointer .)
1552
1552
/// - Any two types with size 0 and alignment 1 are ABI-compatible.
1553
1553
/// - A `repr(transparent)` type `T` is ABI-compatible with its unique non-trivial field, i.e., the
1554
1554
/// unique field that doesn't have size 0 and alignment 1 (if there is such a field).
0 commit comments