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 shows inapplicable blanket implementations #78673

Closed
Nemo157 opened this issue Nov 2, 2020 · 1 comment · Fixed by #78683
Closed

rustdoc shows inapplicable blanket implementations #78673

Nemo157 opened this issue Nov 2, 2020 · 1 comment · Fixed by #78683
Assignees
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 2, 2020

I tried this code:

pub trait Something {}

pub trait AnAmazingTrait {}

impl<T: Something> AnAmazingTrait for T {}

pub struct MyStruct;

impl AnAmazingTrait for MyStruct {}

I expected to see this happen: The specific implementation on MyStruct's doc page

Instead, this happened: Both the specific implementation, and the inapplicable blanket implementation, are shown:

image

Meta

> 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 2, 2020
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Nov 2, 2020
@Nemo157
Copy link
Member Author

Nemo157 commented Nov 2, 2020

@rustbot claim

@bors bors closed this as completed in b63d05a Nov 14, 2020
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Nov 15, 2020
…GuillaumeGomez

Add tests and improve rendering of cfgs on traits

Shows the additional features required to get the trait implementation, suppressing any already shown on the current page. One interesting effect from this is if you have a cfg-ed type, implementing a cfg-ed trait (so the implementation depends on both cfgs), you will get the inverted pair of cfgs shown on each page:

![image](https://user-images.githubusercontent.com/81079/97904671-207bdc00-1d41-11eb-8144-707e8017d2b6.png)

![image](https://user-images.githubusercontent.com/81079/97904700-27a2ea00-1d41-11eb-8b9f-e925ba339044.png)

The hidden items on the trait implementation also now get the correct cfgs displayed on them.

Tests are blocked on rust-lang#78673.

fixes rust-lang#68100
cc rust-lang#43781
m-ou-se added a commit to m-ou-se/rust that referenced this issue Nov 16, 2020
…GuillaumeGomez

Add tests and improve rendering of cfgs on traits

Shows the additional features required to get the trait implementation, suppressing any already shown on the current page. One interesting effect from this is if you have a cfg-ed type, implementing a cfg-ed trait (so the implementation depends on both cfgs), you will get the inverted pair of cfgs shown on each page:

![image](https://user-images.githubusercontent.com/81079/97904671-207bdc00-1d41-11eb-8144-707e8017d2b6.png)

![image](https://user-images.githubusercontent.com/81079/97904700-27a2ea00-1d41-11eb-8b9f-e925ba339044.png)

The hidden items on the trait implementation also now get the correct cfgs displayed on them.

Tests are blocked on rust-lang#78673.

fixes rust-lang#68100
cc rust-lang#43781
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.

2 participants