about summary refs log tree commit diff
path: root/library/core/src/primitive_docs.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-23 05:50:37 +0000
committerbors <bors@rust-lang.org>2024-05-23 05:50:37 +0000
commit6ea763b9e2d41106afbc5b7dbaa3a6f9bfb885f8 (patch)
tree61cbe4964d4e5c0074e9b7d76f8c08d487cd8cd9 /library/core/src/primitive_docs.rs
parent04a9a1a5319eb9c872cc9c753da8b59fc384025d (diff)
parent400835fd11fcaf7c9e904e4f4499630d651268d6 (diff)
Auto merge of #3624 - rust-lang:rustup-2024-05-23, r=RalfJung
Automatic Rustup
Diffstat (limited to 'library/core/src/primitive_docs.rs')
-rw-r--r--library/core/src/primitive_docs.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs
index 8283fdc459b..5989bcbcc52 100644
--- a/library/core/src/primitive_docs.rs
+++ b/library/core/src/primitive_docs.rs
@@ -1476,14 +1476,17 @@ mod prim_usize {}
 ///
 /// For instance, this means that unsafe code in a safe function may assume these invariants are
 /// ensured of arguments passed by the caller, and it may assume that these invariants are ensured
-/// of return values from any safe functions it calls. In most cases, the inverse is also true:
-/// unsafe code must not violate these invariants when passing arguments to safe functions or
-/// returning values from safe functions; such violations may result in undefined behavior. Where
-/// exceptions to this latter requirement exist, they will be called out explicitly in documentation.
+/// of return values from any safe functions it calls.
+///
+/// For the other direction, things are more complicated: when unsafe code passes arguments
+/// to safe functions or returns values from safe functions, they generally must *at least*
+/// not violate these invariants. The full requirements are stronger, as the reference generally
+/// must point to data that is safe to use at type `T`.
 ///
 /// It is not decided yet whether unsafe code may violate these invariants temporarily on internal
 /// data. As a consequence, unsafe code which violates these invariants temporarily on internal data
-/// may become unsound in future versions of Rust depending on how this question is decided.
+/// may be unsound or become unsound in future versions of Rust depending on how this question is
+/// decided.
 ///
 /// [allocated object]: ptr#allocated-object
 #[stable(feature = "rust1", since = "1.0.0")]