about summary refs log tree commit diff
path: root/src/libcoretest/fmt
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-06-30 19:26:03 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-06-30 19:26:03 -0700
commit98566ea951fec6d359e2d98367d34c06e2243ee2 (patch)
tree9366431f53db3c2f163f2a1b228a4ddd25edfbab /src/libcoretest/fmt
parent0b703787ab23f004fe9f635971933c6e9a9c6683 (diff)
downloadrust-98566ea951fec6d359e2d98367d34c06e2243ee2.tar.gz
rust-98566ea951fec6d359e2d98367d34c06e2243ee2.zip
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
Diffstat (limited to 'src/libcoretest/fmt')
-rw-r--r--src/libcoretest/fmt/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcoretest/fmt/mod.rs b/src/libcoretest/fmt/mod.rs
index cdb9c38f027..42872589bb0 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");
 }