about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2025-04-28 01:58:51 +0000
committerGitHub <noreply@github.com>2025-04-28 01:58:51 +0000
commit0ae362bc19704b3e769d61aa1fbee5850d1b9e94 (patch)
tree7429f95dd7d5967b7e65a77aa710b34d88e1f66b
parentbd36f256789a69f636a725f49991c64744681fce (diff)
parent0795b2d646aa6dbaae2f12c50b60ac7e38e0a91d (diff)
downloadrust-0ae362bc19704b3e769d61aa1fbee5850d1b9e94.tar.gz
rust-0ae362bc19704b3e769d61aa1fbee5850d1b9e94.zip
Rollup merge of #140359 - DiuDiu777:str-fix, r=Noratrieb
specify explicit safety guidance for from_utf8_unchecked

The PR addresses missing safety guidelines in two APIs by adding explicit text to the cross-linked reference.
-rw-r--r--library/core/src/str/converts.rs2
-rw-r--r--library/core/src/str/mod.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/str/converts.rs b/library/core/src/str/converts.rs
index 37854a4da64..058628797ea 100644
--- a/library/core/src/str/converts.rs
+++ b/library/core/src/str/converts.rs
@@ -178,7 +178,7 @@ pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
 /// Converts a slice of bytes to a string slice without checking
 /// that the string contains valid UTF-8; mutable version.
 ///
-/// See the immutable version, [`from_utf8_unchecked()`] for more information.
+/// See the immutable version, [`from_utf8_unchecked()`] for documentation and safety requirements.
 ///
 /// # Examples
 ///
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs
index fe35bfdbdf7..818dcc2125f 100644
--- a/library/core/src/str/mod.rs
+++ b/library/core/src/str/mod.rs
@@ -306,7 +306,7 @@ impl str {
     /// Converts a slice of bytes to a string slice without checking
     /// that the string contains valid UTF-8; mutable version.
     ///
-    /// See the immutable version, [`from_utf8_unchecked()`] for more information.
+    /// See the immutable version, [`from_utf8_unchecked()`] for documentation and safety requirements.
     ///
     /// # Examples
     ///