Skip to content

Commit 865d99f

Browse files
committed
docs: Escape brackets to satisfy the linkchecker
My change to use `Type::def_id()` (formerly `Type::def_id_full()`) in more places caused some docs to show up that used to be missed by rustdoc. Those docs contained unescaped square brackets, which triggered linkcheck errors. This commit escapes the square brackets and adds this particular instance to the linkcheck exception list.
1 parent f93cf66 commit 865d99f

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

library/core/src/str/traits.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ unsafe impl SliceIndex<str> for ops::Range<usize> {
234234
/// Implements substring slicing with syntax `&self[.. end]` or `&mut
235235
/// self[.. end]`.
236236
///
237-
/// Returns a slice of the given string from the byte range [`0`, `end`).
237+
/// Returns a slice of the given string from the byte range \[0, `end`).
238238
/// Equivalent to `&self[0 .. end]` or `&mut self[0 .. end]`.
239239
///
240240
/// This operation is *O*(1).
@@ -304,9 +304,8 @@ unsafe impl SliceIndex<str> for ops::RangeTo<usize> {
304304
/// Implements substring slicing with syntax `&self[begin ..]` or `&mut
305305
/// self[begin ..]`.
306306
///
307-
/// Returns a slice of the given string from the byte range [`begin`,
308-
/// `len`). Equivalent to `&self[begin .. len]` or `&mut self[begin ..
309-
/// len]`.
307+
/// Returns a slice of the given string from the byte range \[`begin`, `len`).
308+
/// Equivalent to `&self[begin .. len]` or `&mut self[begin .. len]`.
310309
///
311310
/// This operation is *O*(1).
312311
///
@@ -433,7 +432,7 @@ unsafe impl SliceIndex<str> for ops::RangeInclusive<usize> {
433432
/// Implements substring slicing with syntax `&self[..= end]` or `&mut
434433
/// self[..= end]`.
435434
///
436-
/// Returns a slice of the given string from the byte range [0, `end`].
435+
/// Returns a slice of the given string from the byte range \[0, `end`\].
437436
/// Equivalent to `&self [0 .. end + 1]`, except if `end` has the maximum
438437
/// value for `usize`.
439438
///

library/std/src/sys_common/wtf8.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ impl Wtf8 {
686686
}
687687
}
688688

689-
/// Returns a slice of the given string for the byte range [`begin`..`end`).
689+
/// Returns a slice of the given string for the byte range \[`begin`..`end`).
690690
///
691691
/// # Panics
692692
///

src/tools/linkchecker/main.rs

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ const INTRA_DOC_LINK_EXCEPTIONS: &[(&str, &[&str])] = &[
8585
("core/slice/trait.SliceIndex.html", &["begin</code>, <code>end"]),
8686
("alloc/slice/trait.SliceIndex.html", &["begin</code>, <code>end"]),
8787
("std/slice/trait.SliceIndex.html", &["begin</code>, <code>end"]),
88+
("core/primitive.str.html", &["begin</code>, <code>end"]),
89+
("std/primitive.str.html", &["begin</code>, <code>end"]),
8890

8991
];
9092

0 commit comments

Comments
 (0)