From 84b8f318a54e32f8bce0db0759bdcd3c562b97b3 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Sat, 20 Dec 2014 00:32:07 -0800 Subject: [PATCH] add {:?} fmt syntax --- src/libsyntax/ext/format.rs | 1 + src/test/run-pass/ifmt.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index 5d595474e9c..95c7fcc564a 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -654,6 +654,7 @@ impl<'a, 'b> Context<'a, 'b> { Known(ref tyname) => { match tyname.as_slice() { "" => "Show", + "?" => "Show", "e" => "LowerExp", "E" => "UpperExp", "o" => "Octal", diff --git a/src/test/run-pass/ifmt.rs b/src/test/run-pass/ifmt.rs index 9eac9c30dc8..f3e15562b6d 100644 --- a/src/test/run-pass/ifmt.rs +++ b/src/test/run-pass/ifmt.rs @@ -60,6 +60,7 @@ pub fn main() { t!(format!("{}", 10i), "10"); t!(format!("{}", 10i), "10"); t!(format!("{}", 10u), "10"); + t!(format!("{:?}", true), "true"); t!(format!("{:o}", 10u), "12"); t!(format!("{:x}", 10u), "a"); t!(format!("{:X}", 10u), "A");