Skip to content

rustdoc doesn't consider blanket(!) impls of auto(!) traits #148980

@fmease

Description

@fmease

Background: User-written trait impls of a given type disqualify potential built-in auto trait impls (modulo simplify_type) ignoring some extra details.

Consider the following code:

#![feature(auto_traits)]

pub auto trait Marker {}
pub struct Subject;

impl<T> Marker for T {}

Here, the existence of the blanket impl of Marker disqualifies any auto trait candidates. Meaning Subject impls Marker not due to a built-in auto trait impl but due to the blanket impl.

Therefore I expect to find impl<T> Marker for T under section Blanket Implementations on Subject's page. However, there is no such impl. It does correctly determine it shouldn't synthesize an auto trait impl of Marker for Subject.

If you delete the auto qualifier of trait Marker, then rustdoc will correctly detect and render impl<T> Marker for T.

Metadata

Metadata

Assignees

Labels

A-auto-traitsArea: auto traits (e.g., `auto trait Send {}`)A-synthetic-implsArea: Synthetic impls, used by rustdoc to document auto traits and traits with blanket implsC-bugCategory: This is a bug.F-auto_traits`#![feature(auto_traits)]`P-lowLow priorityT-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