rust/src/libstd
Alex Crichton e423fcf0e0 std: Enforce Unicode in fmt::Writer
This commit is an implementation of [RFC 526][rfc] which is a change to alter
the definition of the old `fmt::FormatWriter`. The new trait, renamed to
`Writer`, now only exposes one method `write_str` in order to guarantee that all
implementations of the formatting traits can only produce valid Unicode.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md

One of the primary improvements of this patch is the performance of the
`.to_string()` method by avoiding an almost-always redundant UTF-8 check. This
is a breaking change due to the renaming of the trait as well as the loss of the
`write` method, but migration paths should be relatively easy:

* All usage of `write` should move to `write_str`. If truly binary data was
  being written in an implementation of `Show`, then it will need to use a
  different trait or an altogether different code path.

* All usage of `write!` should continue to work as-is with no modifications.

* All usage of `Show` where implementations just delegate to another should
  continue to work as-is.

[breaking-change]

Closes #20352
2015-01-01 22:04:46 -08:00
..
collections Test fixes and rebase conflicts 2014-12-31 08:33:13 -08:00
comm Fallout from stabilization 2014-12-30 17:06:08 -08:00
io std: Enforce Unicode in fmt::Writer 2015-01-01 22:04:46 -08:00
num Fallout - change array syntax to use ; 2015-01-02 10:28:19 +13:00
path Fallout from stabilization 2014-12-30 17:06:08 -08:00
rand More fallout 2015-01-02 10:28:19 +13:00
rt std: Enforce Unicode in fmt::Writer 2015-01-01 22:04:46 -08:00
sync Remove core::atomic::Ordering::* public reexport 2014-12-30 11:43:51 -08:00
sys More fallout 2015-01-02 10:28:19 +13:00
thread_local Register new snapshots 2014-12-30 15:04:43 -08:00
time Register new snapshots 2014-12-30 15:04:43 -08:00
ascii.rs Fallout - change array syntax to use ; 2015-01-02 10:28:19 +13:00
bitflags.rs Register new snapshots 2014-12-30 15:04:43 -08:00
bool.rs
c_str.rs More fallout 2015-01-02 10:28:19 +13:00
c_vec.rs
dynamic_lib.rs
error.rs
failure.rs std: Enforce Unicode in fmt::Writer 2015-01-01 22:04:46 -08:00
fmt.rs std: Enforce Unicode in fmt::Writer 2015-01-01 22:04:46 -08:00
hash.rs
lib.rs Revert "std: Re-enable at_exit()" 2014-12-31 10:20:31 -08:00
macros.rs Register new snapshots 2014-12-30 15:04:43 -08:00
os.rs Test fixes and rebase conflicts 2014-12-31 08:33:13 -08:00
prelude.rs Libs: Unify concat and concat_vec 2014-12-30 12:02:22 -08:00
rtdeps.rs
task.rs
thread.rs Revert "std: Re-enable at_exit()" 2014-12-31 10:20:31 -08:00
thunk.rs
tuple.rs
unit.rs