Skip to content

rustdoc: render references to associated type using short form when possible #21145

Closed
@aturon

Description

@aturon

Currently, rustdoc renders the Index trait as:

pub trait Index<Index> where Index: ?Sized {
    type Output;
    fn index(&'a self, index: &Index) -> &'a <Self as Index<Index>>::Output;
}

Ideally it would render as

pub trait Index<Index> where Index: ?Sized {
    type Output;
    fn index(&'a self, index: &Index) -> &'a Self::Output;
}

and eventually, when the scoping rules for associated items are settled, it could skip even the Self::

Metadata

Metadata

Assignees

No one assigned

    Labels

    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