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: Inlined associated types are missing bounds #20727

Closed
tomjakubowski opened this issue Jan 8, 2015 · 6 comments
Closed

rustdoc: Inlined associated types are missing bounds #20727

tomjakubowski opened this issue Jan 8, 2015 · 6 comments
Assignees
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@tomjakubowski
Copy link
Contributor

e.g. compare http://doc.rust-lang.org/core/ops/trait.Deref.html and http://doc.rust-lang.org/std/ops/trait.Deref.html

@nrc nrc added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 8, 2015
@tomjakubowski
Copy link
Contributor Author

N.B. There is an out of date FIXME(#18048) related to this

// FIXME(#18048): this is wrong, but cross-crate associated types are broken
// anyway, for the time being.

(cc #18048)

@nrc
Copy link
Member

nrc commented Jan 9, 2015

Type params seem to be missing the un-bound ?Sized too. I assume this is the same bug, but not 100% sure. E.g., std::ops::Index vs core::ops::Index

@tomjakubowski
Copy link
Contributor Author

Type params in general seem to be missing ?Sized, like in:

// foo.rs
pub fn f<T: ?Sized>(_: &T) { }
// bar.rs
extern crate foo;

pub use foo::f;

I'll make a new issue (#20924).

@SimonSapin
Copy link
Contributor

Possibly the same bug, but impl documentation on re-exported types are also missing things for associated types:

http://doc.rust-lang.org/core/slice/struct.Iter.html#implementations

impl<'a, T> Index<Range<usize>> for Iter<'a, T>
  type Output = [T]
  fn index(&self, index: &Range<usize>) -> &[T]

http://doc.rust-lang.org/std/slice/struct.Iter.html#implementations

impl<'a, T> Index<Range<usize>> for Iter<'a, T>
  fn index(&self, index: &Range<usize>) -> &[T]
  type Output

@tomjakubowski tomjakubowski changed the title rustdoc: Inlined associated types are missing bounds + defaults rustdoc: Inlined associated types are missing bounds Jan 14, 2015
@tomjakubowski
Copy link
Contributor Author

OK, I'm pretty sure that defaults will have to wait until they're actually implemented for associated types, so I've changed the issue title.

@tomjakubowski
Copy link
Contributor Author

Since my last PR landed you can actually see all the bounds on an inlined trait's associated types! Unfortunately it's very ugly (and : Sized appears while : ?Sized doesn't, contrary to a user's expectations).

http://doc.rust-lang.org/std/ops/trait.Add.html

pub trait Add<RHS = Self> where <Self as Add<RHS>>::Output: Sized {
    type Output;
    fn add(self, rhs: RHS) -> <Self as Add<RHS>>::Output;
}

@alexcrichton alexcrichton self-assigned this Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants