about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-21 15:18:57 -0400
committerGitHub <noreply@github.com>2024-09-21 15:18:57 -0400
commit2e43793fd66d5350004c38651e5d20313a3c3526 (patch)
tree2bb86c0fa983ae5b92bdcb4438c88f4415916892 /library
parent3640d114fefac26662b1c49c1fa683feb5ce9dd6 (diff)
parentb94f2931b30402f8a7284832dd4b4b7d251e82a4 (diff)
downloadrust-2e43793fd66d5350004c38651e5d20313a3c3526.tar.gz
rust-2e43793fd66d5350004c38651e5d20313a3c3526.zip
Rollup merge of #130653 - RalfJung:result-abi-compat, r=traviscross
ABI compatibility: mention Result guarantee

This has been already documented in https://doc.rust-lang.org/std/result/index.html#representation, but for `Option` we mirrored those docs in the "ABI compatibility" section, so let's do the same here.

Cc ``@workingjubilee`` ``@rust-lang/lang``
Diffstat (limited to 'library')
-rw-r--r--library/core/src/primitive_docs.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs
index 5451e45f6c8..962da6643dd 100644
--- a/library/core/src/primitive_docs.rs
+++ b/library/core/src/primitive_docs.rs
@@ -1761,6 +1761,8 @@ mod prim_ref {}
 /// - `i32` is ABI-compatible with `NonZero<i32>`, and similar for all other integer types.
 /// - If `T` is guaranteed to be subject to the [null pointer
 ///   optimization](option/index.html#representation), then `T` and `Option<T>` are ABI-compatible.
+///   Furthermore, if `U` satisfies the requirements [outlined here](result/index.html#representation),
+///   then `T` and `Result<T, U>` and `Result<U, T>` are all ABI-compatible.
 ///
 /// Furthermore, ABI compatibility satisfies the following general properties:
 ///