Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: some trait implementors don't have src link #86632

Open
cynecx opened this issue Jun 25, 2021 · 4 comments
Open

rustdoc: some trait implementors don't have src link #86632

cynecx opened this issue Jun 25, 2021 · 4 comments
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@cynecx
Copy link
Contributor

cynecx commented Jun 25, 2021

Live: https://doc.rust-lang.org/nightly/std/iter/trait.IntoIterator.html

Some trait implementors don't have src link and anchors:

image

rustdoc 1.55.0-nightly (7c3872e6b 2021-06-24)
@cynecx cynecx added the C-bug Category: This is a bug. label Jun 25, 2021
@jyn514 jyn514 changed the title rustdoc (nightly): some trait implementors don't have src link rustdoc: some trait implementors don't have src link Jun 26, 2021
@jyn514
Copy link
Member

jyn514 commented Jun 26, 2021

This is also present on stable:
image

@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jun 26, 2021
@GuillaumeGomez
Copy link
Member

The ones who don't have the [src] link are generated by the JS because they come from external crates. Also, the display is broken haha.

@GuillaumeGomez GuillaumeGomez self-assigned this Jul 10, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this issue Jul 12, 2021
…play, r=notriddle

Fix implementors display

Part of rust-lang#86632.

This PR does a few things:
 * It fixes of the JS rendered implementors.
 * It generates anchors for JS rendered implementors to make it coherent with the others.
 * It adds a test to ensure that we won't have the same issue again.
 * It changes the way we render the rustdoc-gui crates to simplify it a bit and also to allow to have dependencies without going through compiletest.

Before:

![Screenshot from 2021-07-10 13-30-13](https://user-images.githubusercontent.com/3050060/125174172-b4048700-e1c3-11eb-8f0e-c46081371d4f.png)

After:

![Screenshot from 2021-07-10 21-11-15](https://user-images.githubusercontent.com/3050060/125174173-b49d1d80-e1c3-11eb-8740-1dbbff70c2eb.png)

I plan to add the `[src]` links in another PR because this one is already big enough.

cc `@Mark-Simulacrum` (for the bootstrap changes)

r? `@Nemo157`
@jsha
Copy link
Contributor

jsha commented Oct 6, 2021

Related: #85418, #25061

@fmease
Copy link
Member

fmease commented Oct 18, 2022

Interestingly, rustdoc does render a source link for e.g. the IntoIterator impl for BinaryHeap on the std::iter::IntoIterator page but not on the core::iter::IntoIterator page. BinaryHeap is defined in alloc and thus this is some kind of cross-crate re-export issue, albeit a bit weird (why is only the core re-export problematic and not the std one?).

@rustbot label A-cross-crate-reexports

@rustbot rustbot added the A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate label Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants