-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
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() {}
Version
rustc 1.2.0-nightly (613e57b44 2015-06-01) (built 2015-06-02)
dflemstr, aldanor and tmcguire
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-rustdoc
3782
Relevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.