You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For integral types, this has no meaning currently.
What that text apparently means today is "we silently ignore any such parameter"
The phrase "has no meaning currently" to me implies that we might add meaning in the future.
I do not even know if we could make this be a static error in a reasonable way for 1.0. But I figured I would ask the question: Should we consider trying to do so? Or should we just commit, for purposes of backwards compatibility, to this being a no-op for integral parameters?
A somewhat related question would be "do we even make any back compat guarantees with respect to the output of formatters?" We obviously won't want to do anything totally crazy like making the default output format for integers hex, but will/should anyone care if we do start using the precision parameter in the future?
As one example, the Debug improvements RFC noted using the precision or width formatter to specify the indentation size in multi-line output as a possible future extension.
I think someone using format! to generate output that is intended to be read by other tools would very much care if we were to silently change the behavior of the precision parameter for the Display trait. It seems like it could be a very nasty bug for someone to track down from one Rust release to the next.
(That's essentially why I'm suggesting we consider trying to catch no-op cases like this today.)
(I also think that we would be within our rights to arbitrarily change the output behavior for the Debug trait.)
Activity
pnkfelix commentedon Apr 24, 2015
nominating (for needs-decision, basically).
sfackler commentedon Apr 24, 2015
A somewhat related question would be "do we even make any back compat guarantees with respect to the output of formatters?" We obviously won't want to do anything totally crazy like making the default output format for integers hex, but will/should anyone care if we do start using the precision parameter in the future?
As one example, the
Debug
improvements RFC noted using the precision or width formatter to specify the indentation size in multi-line output as a possible future extension.pnkfelix commentedon Apr 25, 2015
I think someone using
format!
to generate output that is intended to be read by other tools would very much care if we were to silently change the behavior of theprecision
parameter for theDisplay
trait. It seems like it could be a very nasty bug for someone to track down from one Rust release to the next.(That's essentially why I'm suggesting we consider trying to catch no-op cases like this today.)
(I also think that we would be within our rights to arbitrarily change the output behavior for the
Debug
trait.)pnkfelix commentedon Apr 30, 2015
Consensus is to just say "is ignored for integral types", i.e. get rid of the word "currently" that implies it may change in the future.
Clarify intention wrt integers
Rollup merge of rust-lang#25002 - steveklabnik:gh24767, r=alexcrichton
Rollup merge of rust-lang#25002 - steveklabnik:gh24767, r=alexcrichton
Rollup merge of rust-lang#25002 - steveklabnik:gh24767, r=alexcrichton