]> git.lizzy.rs Git - rust.git/commitdiff
Fallout in libstd: remove impls now considered to conflict.
authorNiko Matsakis <niko@alum.mit.edu>
Mon, 30 Mar 2015 21:50:31 +0000 (17:50 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 1 Apr 2015 15:21:42 +0000 (11:21 -0400)
src/liballoc/boxed.rs
src/liballoc/boxed_test.rs
src/libcore/any.rs
src/libcore/fmt/mod.rs

index adfe0f461bea39363102d82372fa6bcbea19a20c..c4541e34cdb359189778c55b280456062bd1eaa1 100644 (file)
@@ -278,13 +278,6 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
-#[stable(feature = "rust1", since = "1.0.0")]
-impl fmt::Debug for Box<Any> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        f.pad("Box<Any>")
-    }
-}
-
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T: ?Sized> Deref for Box<T> {
     type Target = T;
index 682d5f407c4eaeaf02f23666963cda07a0e63e69..fc44ac4eac628b2eba405276caedb542f5d49bff 100644 (file)
@@ -55,17 +55,17 @@ fn test_show() {
     let b = Box::new(Test) as Box<Any>;
     let a_str = format!("{:?}", a);
     let b_str = format!("{:?}", b);
-    assert_eq!(a_str, "Box<Any>");
-    assert_eq!(b_str, "Box<Any>");
+    assert_eq!(a_str, "Any");
+    assert_eq!(b_str, "Any");
 
     static EIGHT: usize = 8;
     static TEST: Test = Test;
     let a = &EIGHT as &Any;
     let b = &TEST as &Any;
     let s = format!("{:?}", a);
-    assert_eq!(s, "&Any");
+    assert_eq!(s, "Any");
     let s = format!("{:?}", b);
-    assert_eq!(s, "&Any");
+    assert_eq!(s, "Any");
 }
 
 #[test]
index 0ffc4a229b5ae60a934ba2df4a16dae14def0e3d..320fdd50b3510bd41df790ca167bb72857839f85 100644 (file)
@@ -71,6 +71,7 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
+use fmt;
 use marker::Send;
 use mem::transmute;
 use option::Option::{self, Some, None};
@@ -105,6 +106,13 @@ fn get_type_id(&self) -> TypeId { TypeId::of::<T>() }
 // Extension methods for Any trait objects.
 ///////////////////////////////////////////////////////////////////////////////
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl fmt::Debug for Any {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.pad("Any")
+    }
+}
+
 impl Any {
     /// Returns true if the boxed type is the same as `T`
     #[stable(feature = "rust1", since = "1.0.0")]
index ffb358cdac84d90854623e1dc969473269edeb09..3f8bbeb1feb88eb35126a9f16b3efd061141d240 100644 (file)
@@ -12,7 +12,6 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-use any;
 use cell::{Cell, RefCell, Ref, RefMut, BorrowState};
 use char::CharExt;
 use iter::Iterator;
@@ -997,11 +996,6 @@ fn fmt(&self, f: &mut Formatter) -> Result {
 
 tuple! { T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, }
 
-#[stable(feature = "rust1", since = "1.0.0")]
-impl<'a> Debug for &'a (any::Any+'a) {
-    fn fmt(&self, f: &mut Formatter) -> Result { f.pad("&Any") }
-}
-
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T: Debug> Debug for [T] {
     fn fmt(&self, f: &mut Formatter) -> Result {