Skip to content

Rustdoc doesn't follow type aliases in Deref's Target #35295

Closed
@letheed

Description

@letheed

The Methods from Deref<Target=...> will not appear in the documentation if Deref's Target is a type alias.
This works:

pub struct MyVeryLong<AndComplicated<Type>>;
pub type Foo = MyVeryLong<AndComplicated<Type>>;

pub struct Bar;
impl Deref for Bar {
    type Target = MyVeryLong<AndComplicated<Type>>;
    fn deref(&self) -> &Foo { ... }
}

This doesn't:

pub struct MyVeryLong<AndComplicated<Type>>;
pub type Foo = MyVeryLong<AndComplicated<Type>>;

pub struct Bar;
impl Deref for Bar {
    type Target = Foo;
    fn deref(&self) -> &Foo { ... }
}

Metadata

Metadata

Labels

C-bugCategory: This is a bug.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.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