Uh oh!
There was an error while loading. Please reload this page.
Stabilize debug builders - #24847
Conversation
rust-highfive
commented
Apr 26, 2015
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
brson
commented
Apr 26, 2015
bors
commented
Apr 30, 2015
☔ The latest upstream changes (presumably #24967) made this pull request unmergeable. Please resolve the merge conflicts. |
alexcrichton
commented
Apr 30, 2015
We got a chance to talk about this today, and the general feeling here is that this stabilization feels a little rushed. I'm curious, but do you know if there's much usage of this feature today? I was personally unaware of many users of this feature or your Overall these APIs also seem like they haven't been subjected to the scrutiny one might expect from a stable API (from the community at large, not necessarily just us per se). In terms of stabilizing new APIs in the standard library we've toyed with the idea of a "final comment period"-like segment of time where users of Rust can browse soon-to-be-stable APIs, but this would take some infrastructure investment to see it realized. To be clear I don't think the 1.1 window has passed for this feature once we release 1.0, I'm fine cherry picking a change such as this back into beta. |
sfackler
commented
Apr 30, 2015
I'm not aware of a ton of consumers of the API - explicit Debug impls appear to be pretty rare: https://github.com/search?l=rust&p=3&q=%22Debug+for%22&ref=searchresults&type=Code&utf8=%E2%9C%93 Every derived I think a "final comment period" style thing is a good idea, especially for APIs like this that aren't incredibly heavily used. |
bluss
commented
Apr 30, 2015
I used this API recently, and I wanted a way to display one of my fields in hex. Can we find a simple composable way to do that? I sort of wanted something like this to work: |
sfackler
commented
Apr 30, 2015
The most straightforward way to deal with that right now would be something like structDebugHex<T>(T);impl<T:LowerHex>DebugforDebugHex<T>{fnfmt(&self,fmt:&mutFormatter) -> Result{self.0.fmt(fmt)}}
....field("flag",&DebugHex(&tag))
...I'm not sure if there's a way to abstract over |
alexcrichton
commented
Apr 30, 2015
sfackler
commented
May 8, 2015
@bluss Actually realized that my original suggestion is both more verbose than it needs to be and not quite right. We don't want to directly forward the ....
.field("flag",&format_args!("{:x}",self.tag))
.... |
bluss
commented
May 8, 2015
Excellent, that already works! |
f18282b to
e161d5cComparesfackler
commented
May 20, 2015
Rebased and shifted to stabilize for 1.2.0 instead of 1.1.0. |
aturon
commented
May 21, 2015
bors
commented
May 21, 2015
📌 Commit e161d5c has been approved by |
bors
commented
May 21, 2015
⌛ Testing commit e161d5c with merge 258907d... |
bors
commented
May 21, 2015
⛄ The build was interrupted to prioritize another pull request. |
bors
commented
May 21, 2015
⌛ Testing commit e161d5c with merge 806e61f... |
bors
commented
May 22, 2015
💔 Test failed - auto-mac-32-opt |
sfackler
commented
May 22, 2015
@bors retry |
…r=aturon The `debug_builders` feature is up for 1.1 stabilization in rust-lang#24028. This commit stabilizes the API as-is with no changes. Some nits that @alexcrichton mentioned that may be worth discussing now if anyone cares: * Should `debug_tuple_struct` and `DebugTupleStruct` be used instead of `debug_tuple` and `DebugTuple`? It's more typing but is a technically more correct name. * `DebugStruct` and `DebugTuple` have `field` methods while `DebugSet`, `DebugMap` and `DebugList` have `entry` methods. Should we switch those to something else for consistency? cc @alexcrichton@aturon
bors
commented
May 23, 2015
The `debug_builders` feature is up for 1.1 stabilization in #24028. This commit stabilizes the API as-is with no changes. Some nits that @alexcrichton mentioned that may be worth discussing now if anyone cares: * Should `debug_tuple_struct` and `DebugTupleStruct` be used instead of `debug_tuple` and `DebugTuple`? It's more typing but is a technically more correct name. * `DebugStruct` and `DebugTuple` have `field` methods while `DebugSet`, `DebugMap` and `DebugList` have `entry` methods. Should we switch those to something else for consistency? cc @alexcrichton@aturon
bors
commented
May 23, 2015
alexcrichton
commented
May 26, 2015
🌴 |
The
debug_buildersfeature is up for 1.1 stabilization in #24028. This commit stabilizes the API as-is with no changes.Some nits that @alexcrichton mentioned that may be worth discussing now if anyone cares:
debug_tuple_structandDebugTupleStructbe used instead ofdebug_tupleandDebugTuple? It's more typing but is a technically more correct name.DebugStructandDebugTuplehavefieldmethods whileDebugSet,DebugMapandDebugListhaveentrymethods. Should we switch those to something else for consistency?cc @alexcrichton@aturon