Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
letheed opened this issue Aug 4, 2016 · 2 comments · Fixed by #68093
Closed

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

letheed opened this issue Aug 4, 2016 · 2 comments · Fixed by #68093
Assignees
Labels
C-bug Category: This is a bug. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@letheed
Copy link
Contributor

letheed commented Aug 4, 2016

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 { ... }
}
@Mark-Simulacrum Mark-Simulacrum added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label May 10, 2017
@Mark-Simulacrum
Copy link
Member

This is still the case today. The example below, when navigating to Bar's documentation, does not show the method happy.

pub struct FooA;
pub type FooB = FooA;

impl FooA {
        pub fn happy(&self) {}
}

pub struct Bar;
impl std::ops::Deref for Bar {
    type Target = FooB;
    fn deref(&self) -> &FooB { unimplemented!() }
}

@frewsxcv frewsxcv added the T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. label May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 25, 2017
@steveklabnik
Copy link
Member

Triage: no change

@GuillaumeGomez GuillaumeGomez self-assigned this Jan 8, 2020
tmandry added a commit to tmandry/rust that referenced this issue Jan 17, 2020
tmandry added a commit to tmandry/rust that referenced this issue Jan 18, 2020
@bors bors closed this as completed in bafe089 Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants