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 should show methods accessible by more than one deref #26207

Closed
japaric opened this issue Jun 11, 2015 · 4 comments · Fixed by #80653
Closed

rustdoc should show methods accessible by more than one deref #26207

japaric opened this issue Jun 11, 2015 · 4 comments · Fixed by #80653
Assignees
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@japaric
Copy link
Member

japaric commented Jun 11, 2015

STR

use std::ops::Deref;

pub struct Foo(Bar);

pub struct Bar(Baz);

pub struct Baz;

impl Deref for Foo {
    type Target = Bar;

    fn deref(&self) -> &Bar { &self.0 }
}

impl Deref for Bar {
    type Target = Baz;

    fn deref(&self) -> &Baz { &self.0 }
}

impl Bar {
    /// This appears under `Foo` methods
    pub fn shows_up(&self) {}
}

impl Baz {
    /// But this doesn't, because it requires `deref`ing `Foo` twice
    pub fn doesnt_show_up(&self) {}
}

fn test(foo: Foo) {
    // Even though both methods are accessible via `Foo`
    foo.shows_up();
    foo.doesnt_show_up();
}

fn main() {}

20150510234554

Version

rustc 1.2.0-nightly (613e57b44 2015-06-01) (built 2015-06-02)

cc @alexcrichton

@sfackler sfackler added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jun 11, 2015
@jroesch
Copy link
Member

jroesch commented Jun 12, 2015

cc me

@steveklabnik
Copy link
Member

Triage: no changes.

@steveklabnik steveklabnik added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Nov 15, 2016
@retep998
Copy link
Member

Some search terms for future usage: recursive nested.

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@frewsxcv frewsxcv added T-dev-tools-rustdoc and removed T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Dec 10, 2017
@jryans
Copy link
Contributor

jryans commented Jan 4, 2021

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. 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.

8 participants