core: Inherit the unit module

This commit is contained in:
Alex Crichton 2014-04-30 20:50:56 -07:00
parent dfd967f239
commit e7eed5f670
4 changed files with 7 additions and 8 deletions

View File

@ -38,6 +38,7 @@ pub mod container;
/* Core types and methods on primitives */
mod unit;
pub mod any;
pub mod finally;
pub mod raw;

View File

@ -14,7 +14,6 @@
use default::Default;
#[cfg(not(test))]
use cmp::{Eq, Equal, Ord, Ordering, TotalEq, TotalOrd};
use fmt;
#[cfg(not(test))]
impl Eq for () {
@ -44,9 +43,3 @@ impl Default for () {
#[inline]
fn default() -> () { () }
}
impl fmt::Show for () {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.pad("()")
}
}

View File

@ -1250,6 +1250,12 @@ impl<'a> Show for &'a any::Any {
fn fmt(&self, f: &mut Formatter) -> Result { f.pad("&Any") }
}
impl Show for () {
fn fmt(&self, f: &mut Formatter) -> Result {
f.pad("()")
}
}
impl Show for TypeId {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f.buf, "TypeId \\{ {} \\}", self.hash())

View File

@ -190,7 +190,6 @@ pub mod prelude;
#[path = "num/f32.rs"] pub mod f32;
#[path = "num/f64.rs"] pub mod f64;
pub mod unit;
pub mod bool;
pub mod tuple;