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: Support associated types #19174

Merged
merged 2 commits into from
Nov 25, 2014

Conversation

tomjakubowski
Copy link
Contributor

Render associated types on traits and impls, and qualified paths in types.

r? @alexcrichton

@tomjakubowski
Copy link
Contributor Author

Some rendered docs are here: http://homer.crystae.net/doc/foo/

@japaric
Copy link
Member

japaric commented Nov 21, 2014

The render output looks good to me. AFAICT it contains all the necessary information:

  • The associated type appears under the trait
  • Each associated type can be documented
  • Bounds show up in the associated type (type T: Show)
  • The specialization of the associated type shows in the impl (type T = uint)

@tomjakubowski
Copy link
Contributor Author

One thing I'll note is that I couldn't test docs for cross-crate associated types because of an ICE (#18048). I know for a fact that bounds on re-exported associated types will be wrong/missing but there could be other issues too.

@@ -2225,7 +2249,17 @@ impl Clean<Item> for ty::AssociatedType {
source: DUMMY_SP.clean(cx),
name: Some(self.name.clean(cx)),
attrs: Vec::new(),
inner: AssociatedTypeItem,
// FIXME: this is wrong, but cross-crate associated types are broken
// anyway, for the time being.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you reference #18048 here as well?

@alexcrichton
Copy link
Member

@tomjakubowski my hero!

just one tiny nit, and otherwise r=me, fantastic work!

@tomjakubowski
Copy link
Contributor Author

@alexcrichton addressed the nit

@alexcrichton
Copy link
Member

@tomjakubowski I discovered during the recent rollup that this causes rustdoc to fail when generating documentation for the repo, you can see the fix I had at the end of the rollup: alexcrichton@c4fa21d

@tomjakubowski
Copy link
Contributor Author

Whoops! Sorry about that. I could swear I'd done a make docs, but maybe not after the final refactoring and rebasing.

@tomjakubowski
Copy link
Contributor Author

@alexcrichton re-r? I took a slightly different tack and matched on the missing variant while keeping the panic for the _ case. make docs builds fine.

@alexcrichton
Copy link
Member

r+, but needs a rebase

@tomjakubowski
Copy link
Contributor Author

rebased

bors added a commit that referenced this pull request Nov 25, 2014
…crichton

Render associated types on traits and impls, and qualified paths in types.

r? @alexcrichton
@bors bors closed this Nov 25, 2014
@bors bors merged commit de94f0a into rust-lang:master Nov 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants