Skip to content

Commit ca44af2

Browse files
committed
Merge pull request #26901 from alexcrichton/beta-backport
Backporting accepted PRs to beta
2 parents ebf0c83 + fc131b3 commit ca44af2

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

RELEASES.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
Version 1.2.0 (August 2015)
2+
===========================
3+
4+
Highlights
5+
----------
6+
7+
* [Parallel codegen][parcodegen] is now working again, which can substantially
8+
speed up large builds in debug mode; It also gets another ~33% speedup when
9+
bootstrapping on a 4 core machine (using 8 jobs). It's not enabled by default,
10+
but will be "in the near future"
11+
12+
13+
[parcodegen]: https://github.com/rust-lang/rust/pull/26018
14+
15+
116
Version 1.1.0 (June 2015)
217
=========================
318

src/libcore/fmt/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,14 @@ impl Debug for char {
980980
#[stable(feature = "rust1", since = "1.0.0")]
981981
impl Display for char {
982982
fn fmt(&self, f: &mut Formatter) -> Result {
983-
f.write_char(*self)
983+
if f.width.is_none() && f.precision.is_none() {
984+
f.write_char(*self)
985+
} else {
986+
let mut utf8 = [0; 4];
987+
let amt = self.encode_utf8(&mut utf8).unwrap_or(0);
988+
let s: &str = unsafe { mem::transmute(&utf8[..amt]) };
989+
f.pad(s)
990+
}
984991
}
985992
}
986993

src/libcoretest/fmt/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ fn test_format_flags() {
1616
// No residual flags left by pointer formatting
1717
let p = "".as_ptr();
1818
assert_eq!(format!("{:p} {:x}", p, 16), format!("{:p} 10", p));
19+
20+
assert_eq!(format!("{: >3}", 'a'), " a");
1921
}

0 commit comments

Comments
 (0)