rust/src/librustc_driver
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
..
driver.rs std: Enforce Unicode in fmt::Writer 2015-01-01 22:04:46 -08:00
lib.rs rustc_driver: unbox closures used in let bindings 2014-12-31 22:50:27 -05:00
mod.rs Separate the driver into its own crate that uses trans, typeck. 2014-12-04 10:04:52 -05:00
pretty.rs rustc_driver: unbox closures used in let bindings 2014-12-31 22:50:27 -05:00
test.rs Move the scalar types out of static data so that we can put Rc into sty. 2014-12-30 09:34:38 -05:00