Skip to content

Commit a29cb96

Browse files
committed
Disambiguate str doc-links
1 parent bb003e4 commit a29cb96

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

library/alloc/src/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ use crate::vec::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

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

library/core/src/str/mod.rs

Lines changed: 1 addition & 1 deletion
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)