Skip to content

Commit

Permalink
Fallout in libstd: remove impls now considered to conflict.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Apr 1, 2015
1 parent b0af587 commit 30b2d9e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
7 changes: 0 additions & 7 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,6 @@ impl<T: fmt::Debug + ?Sized> fmt::Debug for Box<T> {
}
}

#[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;
Expand Down
8 changes: 4 additions & 4 deletions src/liballoc/boxed_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 8 additions & 0 deletions src/libcore/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -105,6 +106,13 @@ impl<T> Any for 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")]
Expand Down
6 changes: 0 additions & 6 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -997,11 +996,6 @@ macro_rules! tuple {

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 {
Expand Down

0 comments on commit 30b2d9e

Please sign in to comment.