Skip to content

Rustdoc makes trait bounds with associated types overly verbose #102142

Description

@joseph-gio

Location

https://doc.rust-lang.org/std/future/trait.IntoFuture.html

https://doc.rust-lang.org/std/iter/trait.IntoIterator.html

Summary

The definition of the IntoFuture trait looks like:

pub trait IntoFuture {
    type Output;
    type IntoFuture: Future<Output = Self::Output>;
    fn into_future(self) -> Self::IntoFuture;
}

Rustdoc renders this as:

pub trait IntoFuture {
    type Output;
    type IntoFuture: Future
    where
        <Self::IntoFuture as Future>::Output == Self::Output;
    fn into_future(self) -> Self::IntoFuture;
}

This makes the trait bound for the IntoFuture associated type verbose and cryptic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-associated-itemsArea: Associated items (types, constants & functions)A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateA-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.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