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 does not show blanket impls with negative polarity #80466

Open
jyn514 opened this issue Dec 29, 2020 · 5 comments
Open

Rustdoc does not show blanket impls with negative polarity #80466

jyn514 opened this issue Dec 29, 2020 · 5 comments
Labels
C-bug Category: This is a bug. F-negative_impls #![feature(negative_impls)] T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Dec 29, 2020

I tried this code:

#![feature(negative_impls)]
pub struct S {}

pub trait Trait {}
impl<T> !Trait for T {}

I expected to see this happen: Rustdoc shows impl !Trait for S on the documentation for S, the same way it shows impl<T> Any for T.

Instead, this happened: Rustdoc does not show the blanket implementation.

Meta

rustdoc --version: rustdoc 1.50.0-nightly (0edce6f 2020-12-24)

@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. F-negative_impls #![feature(negative_impls)] labels Dec 29, 2020
@jyn514
Copy link
Member Author

jyn514 commented Dec 29, 2020

I think this might be because rustdoc uses for_each_relevant_impl, which only considers impls that do apply, not those that don't?

@jyn514 jyn514 changed the title Rustdoc does not show blankets impls with negative polarity Rustdoc does not show blanket impls with negative polarity Dec 29, 2020
@ThePuzzlemaker
Copy link
Contributor

I think I'll take a shot at this. @rustbot claim

@ThePuzzlemaker
Copy link
Contributor

It appears to be shown on the trait, just not the struct.
image

@ThePuzzlemaker
Copy link
Contributor

It appears that Cache.impls does not contain negative polarity implementations (excluding auto traits, which are obtained separately I believe)

@ThePuzzlemaker
Copy link
Contributor

I'm not really sure how to solve this or what I even need to get help on to solve this so I'm going to release assignment.
@rustbot release-assignment

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. F-negative_impls #![feature(negative_impls)] 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

3 participants