From 79e6ab54d13b8a5b8c17093186c39e493784bdc6 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 27 Feb 2014 20:37:40 -0800 Subject: [PATCH] std: Avoid using "{:?}" in format strings This removes all usage of Poly in format strings from libstd. This doesn't prevent more future strings from coming in, but it at least removes the ones for now. --- src/libnative/io/process.rs | 4 ++-- src/libstd/num/strconv.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs index 0b833f47395..6ac1f2b3692 100644 --- a/src/libnative/io/process.rs +++ b/src/libnative/io/process.rs @@ -470,7 +470,7 @@ unsafe fn set_cloexec(fd: c_int) { Err(e) => { assert!(e.kind == io::BrokenPipe || e.kind == io::EndOfFile, - "unexpected error: {:?}", e); + "unexpected error: {}", e); Ok(SpawnProcessResult { pid: pid, handle: ptr::null() @@ -744,7 +744,7 @@ pub fn WTERMSIG(status: i32) -> i32 { status & 0o177 } let mut status = 0 as c_int; match retry(|| unsafe { wait::waitpid(pid, &mut status, 0) }) { - -1 => fail!("unknown waitpid error: {:?}", super::last_error()), + -1 => fail!("unknown waitpid error: {}", super::last_error()), _ => { if imp::WIFEXITED(status) { p::ExitStatus(imp::WEXITSTATUS(status) as int) diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 153c042c6a8..00497b6f0ea 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -532,19 +532,19 @@ pub fn from_str_bytes_common+ ) -> Option { match exponent { ExpDec if radix >= DIGIT_E_RADIX // decimal exponent 'e' - => fail!("from_str_bytes_common: radix {:?} incompatible with \ + => fail!("from_str_bytes_common: radix {} incompatible with \ use of 'e' as decimal exponent", radix), ExpBin if radix >= DIGIT_P_RADIX // binary exponent 'p' - => fail!("from_str_bytes_common: radix {:?} incompatible with \ + => fail!("from_str_bytes_common: radix {} incompatible with \ use of 'p' as binary exponent", radix), _ if special && radix >= DIGIT_I_RADIX // first digit of 'inf' - => fail!("from_str_bytes_common: radix {:?} incompatible with \ + => fail!("from_str_bytes_common: radix {} incompatible with \ special values 'inf' and 'NaN'", radix), _ if (radix as int) < 2 - => fail!("from_str_bytes_common: radix {:?} to low, \ + => fail!("from_str_bytes_common: radix {} to low, \ must lie in the range [2, 36]", radix), _ if (radix as int) > 36 - => fail!("from_str_bytes_common: radix {:?} to high, \ + => fail!("from_str_bytes_common: radix {} to high, \ must lie in the range [2, 36]", radix), _ => () } -- GitLab