auto merge of #8155 : stepancheg/rust/unit-zero, r=alexcrichton

This commit is contained in:
bors 2013-08-01 04:19:35 -07:00
commit 9824d90ffd
2 changed files with 12 additions and 0 deletions

View File

@ -16,6 +16,10 @@ Functions for the unit type.
#[cfg(not(test))]
use prelude::*;
#[cfg(not(test))]
use num::Zero;
#[cfg(not(test))]
impl Eq for () {
@ -48,3 +52,10 @@ impl TotalEq for () {
#[inline]
fn equals(&self, _other: &()) -> bool { true }
}
#[cfg(not(test))]
impl Zero for () {
fn zero() -> () { () }
fn is_zero(&self) -> bool { true }
}

View File

@ -34,6 +34,7 @@ struct Lots {
h: ~[util::NonCopyable],
i: @mut (int, int),
j: bool,
k: (),
}
fn main() {