Uh oh!
There was an error while loading. Please reload this page.
rustdoc: Cleanup associated const value rendering - #42286
Conversation
rust-highfive
commented
May 28, 2017
(rust_highfive has picked a reviewer for you, use r? to override) |
| } else { | ||
| root.push_str(&seg.name); | ||
| root.push_str("/"); | ||
| if is_not_debug { |
There was a problem hiding this comment.
I'm pretty surprised that we have the same outcome in here.
There was a problem hiding this comment.
With w.alternate() == true it does write!(w, "{}::", seg.name)?;, as can be seen above. The is_not_debug == false case did exactly the same thing.
| } else { | ||
| write!(f, "{:#}::", self_type)? | ||
| } | ||
| if should_show_cast { |
There was a problem hiding this comment.
Once again I'm surprised the code does the same thing.
There was a problem hiding this comment.
The is_not_debug == false case was:
if should_show_cast {write!(f,"<{:?} as {:?}>::", self_type, trait_)?
}else{write!(f,"{:?}::", self_type)?
}The f.alternate() == true case is:
if should_show_cast {write!(f,"<{:#} as {:#}>::", self_type, trait_)?
}else{write!(f,"{:#}::", self_type)?
}GuillaumeGomez
commented
May 30, 2017
Just waiting for some other people to review as well to confirm I didn't miss anything. cc @rust-lang/dev-tools |
steveklabnik
commented
May 30, 2017
@bors: r+ thanks so much! |
bors
commented
May 30, 2017
📌 Commit ef9b2e8 has been approved by |
bors
commented
May 31, 2017
☔ The latest upstream changes (presumably #42318) made this pull request unmergeable. Please resolve the merge conflicts. |
ollie27
commented
May 31, 2017
I've rebased and redone #42318. |
Rather than (ab)using Debug for outputting the type in plain text use the alternate format parameter which already does exactly that. This fixes type parameters for example which would output raw HTML. Also cleans up adding parens around references to trait objects.
| } else { | ||
| write!(f, "&{}{}", lt, m)?; | ||
| } | ||
| write!(f, "(")?; |
GuillaumeGomez
commented
May 31, 2017
Thanks for the update and the improvement! @bors: r+ |
bors
commented
May 31, 2017
📌 Commit 86ea93e has been approved by |
…laumeGomez rustdoc: Cleanup associated const value rendering Rather than (ab)using Debug for outputting the type in plain text use the alternate format parameter which already does exactly that. This fixes type parameters for example which would output raw HTML. Also cleans up adding parens around references to trait objects.
…laumeGomez rustdoc: Cleanup associated const value rendering Rather than (ab)using Debug for outputting the type in plain text use the alternate format parameter which already does exactly that. This fixes type parameters for example which would output raw HTML. Also cleans up adding parens around references to trait objects.
Rather than (ab)using Debug for outputting the type in plain text use the
alternate format parameter which already does exactly that. This fixes
type parameters for example which would output raw HTML.
Also cleans up adding parens around references to trait objects.