about summary refs log tree commit diff
path: root/library/std/src/ffi/os_str.rs
diff options
context:
space:
mode:
authorteor <teor@riseup.net>2025-05-12 18:49:36 +1000
committerteor <teor@riseup.net>2025-05-15 07:58:30 +1000
commit8f0522dc811b7132c3bd2b2bc5c134a869824cf3 (patch)
treeef0d7d88e5e49353991bb285dcf6ba1babb217e6 /library/std/src/ffi/os_str.rs
parentac9ac0e0f36dcd7f8a8f0405cd003585fe4e4426 (diff)
downloadrust-8f0522dc811b7132c3bd2b2bc5c134a869824cf3.tar.gz
rust-8f0522dc811b7132c3bd2b2bc5c134a869824cf3.zip
Fix confusing WTF surrogate safety docs
Diffstat (limited to 'library/std/src/ffi/os_str.rs')
-rw-r--r--library/std/src/ffi/os_str.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs
index 72bdf03ee61..7f0033c1962 100644
--- a/library/std/src/ffi/os_str.rs
+++ b/library/std/src/ffi/os_str.rs
@@ -594,9 +594,9 @@ impl OsString {
     /// The slice must be valid for the platform encoding (as described in
     /// [`OsStr::from_encoded_bytes_unchecked`]).
     ///
-    /// This bypasses the encoding-dependent surrogate joining, so `self` must
-    /// not end with a leading surrogate half and `other` must not start with
-    /// with a trailing surrogate half.
+    /// This bypasses the encoding-dependent surrogate joining, so either
+    /// `self` must not end with a leading surrogate half, or `other` must not
+    /// start with a trailing surrogate half.
     #[inline]
     pub(crate) unsafe fn extend_from_slice_unchecked(&mut self, other: &[u8]) {
         // SAFETY: Guaranteed by caller.