Skip to content

Rustdoc makes trait bounds with associated types overly verbose #102142

Closed
@joseph-gio

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.

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