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 should not render associated items of a negative impl #128799

Closed
dtolnay opened this issue Aug 7, 2024 · 0 comments · Fixed by #128923
Closed

Rustdoc should not render associated items of a negative impl #128799

dtolnay opened this issue Aug 7, 2024 · 0 comments · Fixed by #128923
Assignees
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

@dtolnay
Copy link
Member

dtolnay commented Aug 7, 2024

#![feature(negative_impls)]

pub struct Thing;

impl !Iterator for Thing {}

cargo +nightly doc

I would prefer if only the negative impl signature impl !Iterator for Thing were rendered here (and any doc comment on the negative impl). Not even a collapsed-by-default accordion to show the trait's contents. The reader can click the trait's name to see what is in it if they need.

Having associated items of a negative impl rendered is inconvenient because something like CTRL+F for "fn position" will land the reader deep in the middle of the big impl showing them APIs that their type does not have.

Example of this occurring in standard library documentation: impl<'a, I, A: Allocator> !Iterator for &'a Box<[I], A> {}

Mentioning feature(negative_impls) tracking issue. #68318

@dtolnay dtolnay added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. B-unstable Blocker: Implemented in the nightly compiler and unstable. C-bug Category: This is a bug. F-negative_impls #![feature(negative_impls)] labels Aug 7, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 7, 2024
@fmease fmease removed B-unstable Blocker: Implemented in the nightly compiler and unstable. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 7, 2024
@fmease fmease self-assigned this Aug 7, 2024
@bors bors closed this as completed in 893b9f3 Aug 10, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 10, 2024
Rollup merge of rust-lang#128923 - GuillaumeGomez:negative-impls-items, r=fmease

[rustdoc] Stop showing impl items for negative impls

Fixes rust-lang#128799.

As discussed with `@fmease,` they have a broader patch in progress, so this (small) PR will at least allow for them to have a regression test. :)

r? `@fmease`
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

Successfully merging a pull request may close this issue.

3 participants