about summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-07 17:18:59 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-07 17:18:59 -0800
commita204dc56c97f35632575b1baa008f2e069b1bed9 (patch)
treeb55c302f46d0adb457d3ce2f250bc0b1209d0996 /src/libcollections
parenta6bf7676a545f72cef2e3d042b6d0409f295693a (diff)
parent9851b4fbbf327bb1baab3182ce92970d4db22c6c (diff)
downloadrust-a204dc56c97f35632575b1baa008f2e069b1bed9.tar.gz
rust-a204dc56c97f35632575b1baa008f2e069b1bed9.zip
rollup merge of #20722: alexcrichton/audit-show
Conflicts:
	src/libcollections/vec.rs
	src/libcore/fmt/mod.rs
	src/librustdoc/html/format.rs
Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/string.rs15
-rw-r--r--src/libcollections/vec.rs7
2 files changed, 8 insertions, 14 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs
index 2d8fd159159..32cd8661a56 100644
--- a/src/libcollections/string.rs
+++ b/src/libcollections/string.rs
@@ -681,6 +681,7 @@ impl fmt::Show for FromUtf8Error {
     }
 }
 
+#[stable]
 impl fmt::String for FromUtf8Error {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         fmt::String::fmt(&self.error, f)
@@ -693,6 +694,7 @@ impl fmt::Show for FromUtf16Error {
     }
 }
 
+#[stable]
 impl fmt::String for FromUtf16Error {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         fmt::String::fmt("invalid utf-16: lone surrogate found", f)
@@ -805,7 +807,7 @@ impl Default for String {
     }
 }
 
-#[experimental = "waiting on fmt stabilization"]
+#[stable]
 impl fmt::String for String {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         fmt::String::fmt(&**self, f)
@@ -1274,18 +1276,17 @@ mod tests {
         assert_eq!(2u8.to_string(), "2");
         assert_eq!(true.to_string(), "true");
         assert_eq!(false.to_string(), "false");
-        assert_eq!(().to_string(), "()");
         assert_eq!(("hi".to_string()).to_string(), "hi");
     }
 
     #[test]
     fn test_vectors() {
         let x: Vec<int> = vec![];
-        assert_eq!(x.to_string(), "[]");
-        assert_eq!((vec![1i]).to_string(), "[1]");
-        assert_eq!((vec![1i, 2, 3]).to_string(), "[1, 2, 3]");
-        assert!((vec![vec![], vec![1i], vec![1i, 1]]).to_string() ==
-               "[[], [1], [1, 1]]");
+        assert_eq!(format!("{:?}", x), "[]");
+        assert_eq!(format!("{:?}", vec![1i]), "[1i]");
+        assert_eq!(format!("{:?}", vec![1i, 2, 3]), "[1i, 2i, 3i]");
+        assert!(format!("{:?}", vec![vec![], vec![1i], vec![1i, 1]]) ==
+               "[[], [1i], [1i, 1i]]");
     }
 
     #[test]
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index c2de5d24025..e3b31d2b55d 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -1462,13 +1462,6 @@ impl<T: fmt::Show> fmt::Show for Vec<T> {
     }
 }
 
-#[experimental = "waiting on Show stability"]
-impl<T: fmt::String> fmt::String for Vec<T> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        fmt::String::fmt(self.as_slice(), f)
-    }
-}
-
 impl<'a> fmt::Writer for Vec<u8> {
     fn write_str(&mut self, s: &str) -> fmt::Result {
         self.push_all(s.as_bytes());