Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upFormatting of chars with fixed width was broken? #26625
Comments
This comment has been minimized.
This comment has been minimized.
|
Ooh, that's nasty... first guess is a regression from https://github.com/rust-lang/rust/pull/24689/files . @SimonSapin? |
alexcrichton
added
I-nominated
T-libs
labels
Jun 27, 2015
This comment has been minimized.
This comment has been minimized.
|
Untested fix: impl Display for char {
fn fmt(&self, f: &mut Formatter) -> Result {
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)
}
}
} |
This comment has been minimized.
This comment has been minimized.
|
triage: P-high We're also likely to backport the fix to beta. Note that this is not broken on 1.1.0 stable but it is broken on 1.2.0. |
rust-highfive
added
P-high
and removed
I-nominated
labels
Jun 30, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jul 1, 2015
bors
added a commit
that referenced
this issue
Jul 1, 2015
bors
closed this
in
#26698
Jul 1, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jul 8, 2015
jroesch
added a commit
to jroesch/rust
that referenced
this issue
Jul 21, 2015
thepowersgang
added a commit
to thepowersgang/rust
that referenced
this issue
Jul 25, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
askobara commentedJun 27, 2015
Current code gives different results on stable and nightly branches
Here is the stable:
And here is the nightly: