Skip to content

Some little Rustdoc fixes #21999

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

Merged
merged 4 commits into from
Feb 8, 2015
Merged

Conversation

tomjakubowski
Copy link
Contributor

(e.g., `Self::Output`)

This doesn't actually "resugar" qualified paths like `<Self as
Foo>::Output`, it just doesn't elide the prefix segments when rendering
cleaned paths like `Self::Output`.

cc rust-lang#21145
@@ -460,7 +460,8 @@ impl fmt::Display for clean::Type {
f.write_str(name)
}
clean::ResolvedPath{ did, ref typarams, ref path } => {
try!(resolved_path(f, did, path, false));
// Paths like Self::Output should be rendered with all segments
Copy link
Member

Choose a reason for hiding this comment

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

I believe these sort of associated-type paths exist are possible for any type, that is, they can start with something other than Self. I have no idea how to detect such things.

Copy link
Member

Choose a reason for hiding this comment

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

(In fact, I believe a hybrid path like std::slice::Iter<T>::Item is possible too.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a good point... the ideal rendering of a type like that in rustdocs for a trait would be Iter<T>::Item, with Iter hyperlinked to the appropriate place (possibly in another crate's documentation). So is it a matter of walking path segments and looking for the first non-module and printing the rest of the path from that segment when rendering a path in "short" (less than fully-qualified) form?

@bors
Copy link
Collaborator

bors commented Feb 8, 2015

🙀 You have the wrong number! Please try again with e43c478.

@alexcrichton
Copy link
Member

@bors: r+ e43c478

@bors
Copy link
Collaborator

bors commented Feb 8, 2015

⌛ Testing commit e43c478 with merge cdaf3a4...

@bors bors merged commit e43c478 into rust-lang:master Feb 8, 2015
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