Skip to content

Commit 1094438

Browse files
committed
Disambiguate str doc-links
1 parent b16f73f commit 1094438

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

library/alloc/src/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ use crate::vec::{self, Vec};
352352
///
353353
/// # Invariant
354354
///
355-
/// Rust libraries may assume that `String`s are always valid UTF-8, [just like `str`s](str#invariant).
355+
/// Rust libraries may assume that `String`s are always valid UTF-8, [just like `str`s](prim@str#invariant).
356356
///
357357
/// Constructing a non-UTF-8 `String` is not immediate undefined behavior, but any function
358358
/// called on a `String` may assume that it is valid UTF-8, which means that a non-UTF-8 `String`

library/core/src/str/converts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
149149
/// This function is unsafe because it does not check that the bytes passed
150150
/// to it are valid UTF-8. If this constraint is violated, it may cause
151151
/// memory unsafety issues with future users of the `str`, as the rest of
152-
/// the standard library [assumes that `str`s are valid UTF-8](str#invariant).
152+
/// the standard library [assumes that `str`s are valid UTF-8](prim@str#invariant).
153153
///
154154
/// # Examples
155155
///

library/core/src/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ impl str {
313313
/// bytes which are not valid UTF-8. If this constraint is violated, using
314314
/// the original `str` after the `&mut [u8]` borrow expires may violate memory
315315
/// safety, as the rest of the standard library [assumes that `str`s are
316-
/// valid UTF-8](str#invariant).
316+
/// valid UTF-8](prim@str#invariant).
317317
///
318318
/// # Examples
319319
///

0 commit comments

Comments
 (0)