Skip to content

Commit 0ae362b

Browse files
authored
Rollup merge of rust-lang#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.
2 parents bd36f25 + 0795b2d commit 0ae362b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/core/src/str/converts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
178178
/// Converts a slice of bytes to a string slice without checking
179179
/// that the string contains valid UTF-8; mutable version.
180180
///
181-
/// See the immutable version, [`from_utf8_unchecked()`] for more information.
181+
/// See the immutable version, [`from_utf8_unchecked()`] for documentation and safety requirements.
182182
///
183183
/// # Examples
184184
///

library/core/src/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl str {
306306
/// Converts a slice of bytes to a string slice without checking
307307
/// that the string contains valid UTF-8; mutable version.
308308
///
309-
/// See the immutable version, [`from_utf8_unchecked()`] for more information.
309+
/// See the immutable version, [`from_utf8_unchecked()`] for documentation and safety requirements.
310310
///
311311
/// # Examples
312312
///

0 commit comments

Comments
 (0)