Skip to content

Commit d028913

Browse files
committed
---
yaml --- r: 67514 b: refs/heads/master c: 9824d90 h: refs/heads/master v: v3
1 parent 2cfd2cf commit d028913

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5c6069c7a90761c120cecbd8e18317bce21dd213
2+
refs/heads/master: 9824d90ffd7684eca7171c4e019fd85b9317904e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libstd/nil.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Functions for the unit type.
1616

1717
#[cfg(not(test))]
1818
use prelude::*;
19+
#[cfg(not(test))]
20+
use num::Zero;
21+
22+
1923

2024
#[cfg(not(test))]
2125
impl Eq for () {
@@ -48,3 +52,10 @@ impl TotalEq for () {
4852
#[inline]
4953
fn equals(&self, _other: &()) -> bool { true }
5054
}
55+
56+
#[cfg(not(test))]
57+
impl Zero for () {
58+
fn zero() -> () { () }
59+
fn is_zero(&self) -> bool { true }
60+
}
61+

trunk/src/test/run-pass/deriving-zero.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct Lots {
3434
h: ~[util::NonCopyable],
3535
i: @mut (int, int),
3636
j: bool,
37+
k: (),
3738
}
3839

3940
fn main() {

0 commit comments

Comments
 (0)