Skip to content

rustdoc: notable traits triggers on smart pointers #100320

Closed
@jsha

Description

@jsha

The Pin and Box documentation shows "notable traits" on the new() method, and any other methods that return a Pin or a Box:

https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.new
https://doc.rust-lang.org/nightly/std/pin/struct.Pin.html#method.new

image

That's because these structs have "pass-through" implementations: if T implements Iterator, then Box<T> implements Iterator. If T implements Read, then Box<T> implements Read. Since new() returns Box<T>, it gets the ⓘ icon indicating a notable trait.

These return types should not be annotated with the ⓘ, since "notable traits" should be reserved for things that are actually notable - like the Iterator impl on std::slice::Iter.

One way to achieve this: if the where bounds for the impl include the "notable trait", don't consider that impl eligible for ⓘ treatment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)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