From 8dff253d243615ac4c35f59598d0d36034f91ecd Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 30 Jun 2015 19:26:03 -0700 Subject: [PATCH 1/2] std: Fix formatting flags for chars This recently regressed in #24689, and this updates the `Display` implementation to take formatting flags into account. Closes #26625 --- src/libcore/fmt/mod.rs | 9 ++++++++- src/libcoretest/fmt/mod.rs | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index cbbb186af7609..343772c764f81 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -980,7 +980,14 @@ impl Debug for char { #[stable(feature = "rust1", since = "1.0.0")] impl Display for char { fn fmt(&self, f: &mut Formatter) -> Result { - f.write_char(*self) + if f.width.is_none() && f.precision.is_none() { + f.write_char(*self) + } else { + let mut utf8 = [0; 4]; + let amt = self.encode_utf8(&mut utf8).unwrap_or(0); + let s: &str = unsafe { mem::transmute(&utf8[..amt]) }; + f.pad(s) + } } } diff --git a/src/libcoretest/fmt/mod.rs b/src/libcoretest/fmt/mod.rs index cdb9c38f027f7..42872589bb01f 100644 --- a/src/libcoretest/fmt/mod.rs +++ b/src/libcoretest/fmt/mod.rs @@ -16,4 +16,6 @@ fn test_format_flags() { // No residual flags left by pointer formatting let p = "".as_ptr(); assert_eq!(format!("{:p} {:x}", p, 16), format!("{:p} 10", p)); + + assert_eq!(format!("{: >3}", 'a'), " a"); } From fc131b3f16443e8f9b151243b19ef27187d04187 Mon Sep 17 00:00:00 2001 From: Cruz Julian Bishop Date: Sat, 27 Jun 2015 09:16:11 +1000 Subject: [PATCH 2/2] Initial documentation for 1.2.0, uploading to test markdown --- RELEASES.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 9932684a34cc4..54c71611ea803 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,18 @@ +Version 1.2.0 (August 2015) +=========================== + +Highlights +---------- + +* [Parallel codegen][parcodegen] is now working again, which can substantially + speed up large builds in debug mode; It also gets another ~33% speedup when + bootstrapping on a 4 core machine (using 8 jobs). It's not enabled by default, + but will be "in the near future" + + +[parcodegen]: https://github.com/rust-lang/rust/pull/26018 + + Version 1.1.0 (June 2015) =========================