Uh oh!
There was an error while loading. Please reload this page.
Refactor to use debug_struct in several Debug impls - #44775
Conversation
rust-highfive
commented
Sep 22, 2017
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
The {{ and }} need to be changed to { and } as this string is no longer being used as a format string.
There was a problem hiding this comment.
Good catch, thanks for the review!
I removed the double braces.
b694349 to
3139584Comparesfackler
commented
Sep 25, 2017
I don't think this really fixes what #44771 was talking about - the output is still going to be on a single line if you format with |
I've tested on my machine that: println!("{:#?}", std::sync::Mutex::new(5));prints (because of Mutex{data:5}But you're right that for e.g. I think this is another related issue that we can fix later, because I just refactored this part to be more consistent with other |
carols10cents
commented
Oct 2, 2017
ping @sfackler - do you think this can be merged as-is to fix part of the problem? |
sfackler
commented
Oct 3, 2017
The proper change seems like |
MaloJaffre
commented
Oct 7, 2017
Using |
sfackler
commented
Oct 8, 2017
Yep, debug representations aren't stable. |
MaloJaffre
commented
Oct 8, 2017
I've rebased and applied the requested changes.
With these changes, fnmain(){let a = std::sync::Mutex::new(5);let b = a.lock().unwrap();println!("{:#?}", a);}prints: Mutex{
data: <locked>
} |
sfackler
commented
Oct 8, 2017
Thanks! @bors r+ rollup |
bors
commented
Oct 8, 2017
📌 Commit 7b02a2d has been approved by |
kennytm
commented
Oct 9, 2017
@bors r- CI failed. |
MaloJaffre
commented
Oct 9, 2017
Sorry for the failed CI, this should be fixed now. |
sfackler
commented
Oct 9, 2017
Can we just get rid of those tests? It doesn't seem like they're doing anything useful. |
MaloJaffre
commented
Oct 9, 2017
Sure, I've removed these tests and squashed commits. |
sfackler
commented
Oct 9, 2017
@bors r+ rollup |
bors
commented
Oct 9, 2017
📌 Commit 679457a has been approved by |
Refactor to use `debug_struct` in several Debug impls Also use `pad` and derive `Debug` for `Edge`. Fixesrust-lang#44771.
Also use
padand deriveDebugforEdge.Fixes#44771.