Skip to content

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

Closed
@dtolnay

Description

@dtolnay
#![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

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-negative_impls#![feature(negative_impls)]T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions