Skip to content

Commit 30b2d9e

Browse files
committed
Fallout in libstd: remove impls now considered to conflict.
1 parent b0af587 commit 30b2d9e

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

src/liballoc/boxed.rs

-7
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,6 @@ impl<T: fmt::Debug + ?Sized> fmt::Debug for Box<T> {
278278
}
279279
}
280280

281-
#[stable(feature = "rust1", since = "1.0.0")]
282-
impl fmt::Debug for Box<Any> {
283-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
284-
f.pad("Box<Any>")
285-
}
286-
}
287-
288281
#[stable(feature = "rust1", since = "1.0.0")]
289282
impl<T: ?Sized> Deref for Box<T> {
290283
type Target = T;

src/liballoc/boxed_test.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ fn test_show() {
5555
let b = Box::new(Test) as Box<Any>;
5656
let a_str = format!("{:?}", a);
5757
let b_str = format!("{:?}", b);
58-
assert_eq!(a_str, "Box<Any>");
59-
assert_eq!(b_str, "Box<Any>");
58+
assert_eq!(a_str, "Any");
59+
assert_eq!(b_str, "Any");
6060

6161
static EIGHT: usize = 8;
6262
static TEST: Test = Test;
6363
let a = &EIGHT as &Any;
6464
let b = &TEST as &Any;
6565
let s = format!("{:?}", a);
66-
assert_eq!(s, "&Any");
66+
assert_eq!(s, "Any");
6767
let s = format!("{:?}", b);
68-
assert_eq!(s, "&Any");
68+
assert_eq!(s, "Any");
6969
}
7070

7171
#[test]

src/libcore/any.rs

+8
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
7272
#![stable(feature = "rust1", since = "1.0.0")]
7373

74+
use fmt;
7475
use marker::Send;
7576
use mem::transmute;
7677
use option::Option::{self, Some, None};
@@ -105,6 +106,13 @@ impl<T> Any for T
105106
// Extension methods for Any trait objects.
106107
///////////////////////////////////////////////////////////////////////////////
107108

109+
#[stable(feature = "rust1", since = "1.0.0")]
110+
impl fmt::Debug for Any {
111+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
112+
f.pad("Any")
113+
}
114+
}
115+
108116
impl Any {
109117
/// Returns true if the boxed type is the same as `T`
110118
#[stable(feature = "rust1", since = "1.0.0")]

src/libcore/fmt/mod.rs

-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
1313
#![stable(feature = "rust1", since = "1.0.0")]
1414

15-
use any;
1615
use cell::{Cell, RefCell, Ref, RefMut, BorrowState};
1716
use char::CharExt;
1817
use iter::Iterator;
@@ -997,11 +996,6 @@ macro_rules! tuple {
997996

998997
tuple! { T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, }
999998

1000-
#[stable(feature = "rust1", since = "1.0.0")]
1001-
impl<'a> Debug for &'a (any::Any+'a) {
1002-
fn fmt(&self, f: &mut Formatter) -> Result { f.pad("&Any") }
1003-
}
1004-
1005999
#[stable(feature = "rust1", since = "1.0.0")]
10061000
impl<T: Debug> Debug for [T] {
10071001
fn fmt(&self, f: &mut Formatter) -> Result {

0 commit comments

Comments
 (0)