-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Some little Rustdoc fixes #21999
Conversation
cf20a68
to
700e6c6
Compare
(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
700e6c6
to
e43c478
Compare
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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?
🙀 You have the wrong number! Please try again with |
r? @alexcrichton