Uh oh!
There was an error while loading. Please reload this page.
Implement RFC 640 - #23162
Conversation
brson
commented
Mar 8, 2015
alexcrichton
commented
Mar 8, 2015
I'll take a closer look at this tomorrow, but I'm curious why you applied |
sfackler
commented
Mar 8, 2015
The public API takes |
alexcrichton
commented
Mar 10, 2015
Ah ok. If we're trying to minimize codegen though I would probably recommend a In general I'm not so sure about the application of Otherwise, my only other concern is the usage in |
sfackler
commented
Mar 10, 2015
I will collect some statistics. The deriving implementation uses the functionality @huonw added to be able to call unstable APIs without triggering feature gates. |
alexcrichton
commented
Mar 10, 2015
Ah excellent. cc @huonw on the |
There was a problem hiding this comment.
Did you find that this was necessary? I'm under the impression that the macro infrastructure manages re-spanning everything after a macro expansion?
There was a problem hiding this comment.
It did not appear to respan - I think only the macro_rules! infrastructure may do that.
huonw
commented
Mar 10, 2015
Looks great. Is it worth putting these under a different feature gate to |
Switching from generic bounds to trait objects and having un-inlined inner methods should cut down on the size of Debug impls, since we care about the speed of a Debug implementation way less than binary bloat.
Turns out it's basically a wash, codegen wise.
sfackler
commented
Mar 11, 2015
So it turns out that no-inline silliness actually ends up a tiny bit smaller than inline silliness: https://gist.github.com/sfackler/a9300bce13ad166cd35b. Looks like the builder structs are small enough that the copies don't matter. I pushed a commit that cuts out all the inline annotations. |
sfackler
commented
Mar 11, 2015
Oh, and there doesn't appear to be much of a difference one way or another for overall binary sizes before and after the |
alexcrichton
commented
Mar 11, 2015
Thanks for investigating!
Ah well, it probably at least paves the way in the future for such changes though. |
alexcrichton
commented
Mar 11, 2015
This looks great to me! r=me with a feature name that's not |
sfackler
commented
Mar 11, 2015
bors
commented
Mar 12, 2015
I've made some minor changes from the implementation attached to the RFC to try to minimize codegen. The methods now take `&Debug` trait objects rather than being parameterized and there are inlined stub methods that call to non-inlined methods to do the work. r? @alexcrichton cc @huonw for the `derive(Debug)` changes.
bors
commented
Mar 12, 2015
💔 Test failed - auto-linux-32-nopt-t |
sfackler
commented
Mar 12, 2015
@bors retry Seems like a spurious error?? |
bors
commented
Mar 12, 2015
⚡ Previous build results for auto-linux-32-opt, auto-linux-64-nopt-t, auto-mac-32-opt, auto-mac-64-nopt-t, auto-mac-64-opt are reusable. Rebuilding only auto-linux-32-nopt-t, auto-linux-64-opt, auto-linux-64-x-android-t, auto-win-32-nopt-t, auto-win-32-opt, auto-win-64-nopt-t, auto-win-64-opt... |
bors
commented
Mar 12, 2015
⛄ The build was interrupted to prioritize another pull request. |
bors
commented
Mar 12, 2015
⚡ Previous build results for auto-linux-32-opt, auto-linux-64-nopt-t, auto-mac-32-opt, auto-mac-64-nopt-t, auto-mac-64-opt are reusable. Rebuilding only auto-linux-32-nopt-t, auto-linux-64-opt, auto-linux-64-x-android-t, auto-win-32-nopt-t, auto-win-32-opt, auto-win-64-nopt-t, auto-win-64-opt... |
bors
commented
Mar 12, 2015
⛄ The build was interrupted to prioritize another pull request. |
I've made some minor changes from the implementation attached to the RFC to try to minimize codegen. The methods now take `&Debug` trait objects rather than being parameterized and there are inlined stub methods that call to non-inlined methods to do the work. r? @alexcrichton cc @huonw for the `derive(Debug)` changes.
bors
commented
Mar 12, 2015
bors
commented
Mar 12, 2015
SimonSapin
commented
Apr 2, 2015
Should |
liigo
commented
Jul 8, 2015
keywords: pretty debug builders |
sunjay
commented
Jun 4, 2016
@SimonSapin It would be great is |
I've made some minor changes from the implementation attached to the RFC to try to minimize codegen. The methods now take
&Debugtrait objects rather than being parameterized and there are inlined stub methods that call to non-inlined methods to do the work.r? @alexcrichton
cc @huonw for the
derive(Debug)changes.