Skip to content

rustdoc prints types in traits different than rustc #22000

@RalfJung

Description

@RalfJung

The syntax that rustdoc uses to refer to types declared internally within a trait ("associated types"), is different from what rustc expects. This is fairly confusing for a newbie, who tries to learn the language by example - in particular, by looking at how the standard API does things.

For example, the documentation of the Iterator trait http://doc.rust-lang.org/std/iter/trait.Iterator.html refers to the type "Item" simply by "Item", but I have to write "Self::Item" for this code to actually compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions