Skip to content

Fixed doc links for [T]::concat and [T]::join#152784

Closed
asder8215 wants to merge 1 commit intorust-lang:mainfrom
asder8215:alloc_slice_doc
Closed

Fixed doc links for [T]::concat and [T]::join#152784
asder8215 wants to merge 1 commit intorust-lang:mainfrom
asder8215:alloc_slice_doc

Conversation

@asder8215
Copy link
Contributor

@asder8215 asder8215 commented Feb 18, 2026

This PR fixes the issue mentioned in #151153. It does this through using a bit of JS to link it to std::slice::concat and std::slice::join, so it's a little bit of a hacky solution. See comment in the commit for reasoning on why we (afaik) intra doc link isn't working for this.

@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 Feb 18, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 18, 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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 7 candidates
  • Random selection from Mark-Simulacrum, jhpratt, joboet

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@joboet
Copy link
Member

joboet commented Feb 25, 2026

r? rustdoc
This works, but maybe there is a better solution?

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 25, 2026
@rustbot rustbot assigned GuillaumeGomez and unassigned joboet Feb 25, 2026
@GuillaumeGomez
Copy link
Member

Aren't relative paths working instead of adding JS in docs?

@asder8215
Copy link
Contributor Author

Aren't relative paths working instead of adding JS in docs?

See #151170.
On local, we need to do ../../std/primitive.slice.html#method.concat

But for this to work on the doc website, we need to do ../std/primitive.slice.html#method.concat. Otherwise, we have a file not found/page doesn't exist error either on website or local.

@GuillaumeGomez
Copy link
Member

On local it's doc/std/index.html and on remote it's nightly/std/index.html. Seems to be the same, no?

@asder8215
Copy link
Contributor Author

asder8215 commented Feb 25, 2026

On local it's doc/std/index.html and on remote it's nightly/std/index.html. Seems to be the same, no?

When I go on the website and inspect the href for the [T]::concat link in:
https://doc.rust-lang.org/alloc/slice/trait.Concat.html
it shows:
image
Changing this to ../../std/primitive.slice.html#method.concat will link to the right page while changing this to ../std/primitive.slice.html#method.concat will result in a page not found error. On local, when I build the docs through ./x doc --stage 1 library --open, it's the vice versa.

@GuillaumeGomez
Copy link
Member

In any case, I think it should be fixed in rustdoc and not in the docs directly.

@asder8215
Copy link
Contributor Author

Got it, I'll close this PR for now. Is there a place I should take a look in librustdoc to attempt fixing this?

@asder8215 asder8215 closed this Feb 25, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 25, 2026
@GuillaumeGomez
Copy link
Member

There was a discussion about this in #152917. That might be a good start.

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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants