Skip to content

fix broken doc links in alloc::slice#151170

Closed
ericseppanen wants to merge 1 commit intorust-lang:mainfrom
ericseppanen:slice_traits_doc_fix
Closed

fix broken doc links in alloc::slice#151170
ericseppanen wants to merge 1 commit intorust-lang:mainfrom
ericseppanen:slice_traits_doc_fix

Conversation

@ericseppanen
Copy link
Contributor

@ericseppanen ericseppanen commented Jan 15, 2026

Fix broken links in alloc::slice docs ([T]::concat and [T]::join).

The intra-doc links try to go to core's primitive slice docs, but the linked methods aren't documented there. Use manual links to std's primitive slice instead, which seems to be how other modules in alloc handle doc links to std.

I verified that this fixes the broken links locally, and has no impact on the std::slice module docs.

Fixes #151153.

The intra-doc links try to go to `core::slice`, but the linked methods
aren't documented there. Use manual links to `std::slice` instead.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 15, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 15, 2026

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
[TIMING:end] tool::ToolBuild { build_compiler: Compiler { stage: 0, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu, tool: "linkchecker", path: "src/tools/linkchecker", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 0.149
[TIMING:end] tool::Linkchecker { compiler: Compiler { stage: 0, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu } -- 0.000
##[group]Testing stage1 Linkcheck (aarch64-unknown-linux-gnu)
std/primitive.str.html:1580: broken link - `/checkout/obj/build/aarch64-unknown-linux-gnu/std/primitive.slice.html`
std/primitive.str.html:1667: broken link - `/checkout/obj/build/aarch64-unknown-linux-gnu/std/primitive.slice.html`
std/ffi/os_str/struct.OsStr.html:231: broken link - `std/std/primitive.slice.html`
checked links in: 21.9s
number of HTML files scanned: 46582
number of HTML redirects found: 14604
number of links checked: 2581696
number of links ignored due to external: 128367
number of links ignored due to exceptions: 24
number of intra doc links ignored: 9
errors found: 3
found some broken links
NOTE: if you are adding or renaming a markdown file in a mdBook, don't forget to register the page in SUMMARY.md
Bootstrap failed while executing `--stage 2 test --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest`
Command `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools-bin/linkchecker /checkout/obj/build/aarch64-unknown-linux-gnu/doc` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1612:23
Executed at: src/bootstrap/src/core/build_steps/test.rs:190:77

Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:31:55
  local time: Thu Jan 15 19:09:47 UTC 2026
  network time: Thu, 15 Jan 2026 19:09:47 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

@ericseppanen
Copy link
Contributor Author

ericseppanen commented Jan 15, 2026

The linkcheck failures appear to be caused by the docs for the impl Join and impl Concat blocks (which inline the trait docs for the join and concat methods).

In primitive.str.html the problem seems to be that the path ../../std is wrong; from this context it would be ../std. I'm not sure how to fix that, since the relative path will be different depending on the page.

In ffi/os_str/struct.OsStr.html the problem is similar: the path is ../../../std.

So hardcoding the relative path isn't going to work for traits. I guess I need to find another way.

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

alloc::slice docs have broken links

4 participants