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 links to non-blanket impl for blanket impl in sidebar #78701

Closed
Nemo157 opened this issue Nov 3, 2020 · 0 comments · Fixed by #94417
Closed

rustdoc links to non-blanket impl for blanket impl in sidebar #78701

Nemo157 opened this issue Nov 3, 2020 · 0 comments · Fixed by #94417
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Nemo157
Copy link
Member

Nemo157 commented Nov 3, 2020

I tried this code:

pub trait Something {}

pub trait AnAmazingTrait {}

impl<T: Something> AnAmazingTrait for T {}

pub struct AnotherStruct<T>(T);

impl<T: Something> Something for AnotherStruct<T> {}
impl AnAmazingTrait for AnotherStruct<()> {}

I expected to see this happen: Two links in the sidebar of AnotherStruct to AnAmazingTrait, one under "Trait Implementations" going to the specific impl, another under "Blanket Implementations" going to the blanket impl.

Instead, this happened: Two links in the sidebar, but both link to the specific impl.

Meta

12:34 → rustdoc -vV
rustdoc 1.49.0-nightly (31530e5d1 2020-10-20)
binary: rustdoc
commit-hash: 31530e5d132ebcc3654baf2e5460599681520af0
commit-date: 2020-10-20
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly
LLVM version: 11.0

@rustbot modify labels: +T-rustdoc

@Nemo157 Nemo157 added the C-bug Category: This is a bug. label Nov 3, 2020
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Nov 3, 2020
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 27, 2022
…links, r=notriddle

Fix duplicated impl links

Fixes rust-lang#78701.

The problem is that the blanket impl has the same ID as the other impl, except that we don't derive IDs when we generate the sidebar. We now do.

r? `@notriddle`
@bors bors closed this as completed in 04ecf52 Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

Successfully merging a pull request may close this issue.

3 participants