Skip to content

Commit b7fb4d7

Browse files
committed
Fix linkcheck issues
Most of these are because alloc uses `#[lang_item]` to define methods, but core documents primitives before those methods are available. - Fix rustdoc-js-std test For some reason this change made CStr not show up in the results for `str,u8`. Since it still shows up for str, and since it wasn't a great match for that query anyway, I think this is ok to let slide. - Add test that all primitives can be linked to - Enable `doc(primitive)` in `core` as well - Add linkcheck exception specifically for Windows Ideally this would be done automatically by the linkchecker by replacing `\\` with forward slashes, but this PR is already a ton of work ... - Don't forcibly fail linkchecking if there's a broken intra-doc link on Windows Previously, it would exit with a hard error if a missing file had `::` in it. This changes it to report a missing file instead, which allows adding an exception.
1 parent bd49226 commit b7fb4d7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/src/char/methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl char {
2424
/// decoding error.
2525
///
2626
/// It can occur, for example, when giving ill-formed UTF-8 bytes to
27-
/// [`String::from_utf8_lossy`](string/struct.String.html#method.from_utf8_lossy).
27+
/// [`String::from_utf8_lossy`](../std/string/struct.String.html#method.from_utf8_lossy).
2828
#[stable(feature = "assoc_char_consts", since = "1.52.0")]
2929
pub const REPLACEMENT_CHARACTER: char = '\u{FFFD}';
3030

core/src/slice/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,9 +2257,9 @@ impl<T> [T] {
22572257
/// assert!(match r { Ok(1..=4) => true, _ => false, });
22582258
/// ```
22592259
// Lint rustdoc::broken_intra_doc_links is allowed as `slice::sort_by_key` is
2260-
// in crate `alloc`, and as such doesn't exists yet when building `core`.
2261-
// links to downstream crate: #74481. Since primitives are only documented in
2262-
// libstd (#73423), this never leads to broken links in practice.
2260+
// in crate `alloc`, and as such doesn't exists yet when building `core`: #74481.
2261+
// This breaks links when slice is displayed in core, but changing it to use relative links
2262+
// would break when the item is re-exported. So allow the core links to be broken for now.
22632263
#[allow(rustdoc::broken_intra_doc_links)]
22642264
#[stable(feature = "slice_binary_search_by_key", since = "1.10.0")]
22652265
#[inline]

0 commit comments

Comments
 (0)