Skip to content

Commit 1a5bc89

Browse files
committed
---
yaml --- r: 80733 b: refs/heads/try c: 43aba85 h: refs/heads/master i: 80731: 5865481 v: v3
1 parent 92faba8 commit 1a5bc89

File tree

3 files changed

+8
-26
lines changed

3 files changed

+8
-26
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cbd1eefbd350797b783df119fed7956d7e1c74ad
5-
refs/heads/try: a0e123eb6e2c0a971dd4e9e2c49e2ceed0d73672
5+
refs/heads/try: 43aba856b4a8d1b2068f1f5c5017934442d2aedd
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libstd/vec.rs

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ use cmp;
107107
use default::Default;
108108
use iter::*;
109109
use libc::c_void;
110-
use num::{Integer, Zero, CheckedAdd, Saturating};
110+
use num::{Integer, CheckedAdd, Saturating};
111111
use option::{None, Option, Some};
112112
use ptr::to_unsafe_ptr;
113113
use ptr;
@@ -2250,22 +2250,6 @@ impl<A> Default for @[A] {
22502250
fn default() -> @[A] { @[] }
22512251
}
22522252

2253-
// This works because every lifetime is a sub-lifetime of 'static
2254-
impl<'self, A> Zero for &'self [A] {
2255-
fn zero() -> &'self [A] { &'self [] }
2256-
fn is_zero(&self) -> bool { self.is_empty() }
2257-
}
2258-
2259-
impl<A> Zero for ~[A] {
2260-
fn zero() -> ~[A] { ~[] }
2261-
fn is_zero(&self) -> bool { self.len() == 0 }
2262-
}
2263-
2264-
impl<A> Zero for @[A] {
2265-
fn zero() -> @[A] { @[] }
2266-
fn is_zero(&self) -> bool { self.len() == 0 }
2267-
}
2268-
22692253
macro_rules! iterator {
22702254
/* FIXME: #4375 Cannot attach documentation/attributes to a macro generated struct.
22712255
(struct $name:ident -> $ptr:ty, $elem:ty) => {
@@ -3602,13 +3586,12 @@ mod tests {
36023586
}
36033587

36043588
#[test]
3605-
fn test_vec_zero() {
3606-
use num::Zero;
3589+
fn test_vec_default() {
3590+
use default::Default;
36073591
macro_rules! t (
36083592
($ty:ty) => {{
3609-
let v: $ty = Zero::zero();
3593+
let v: $ty = Default::default();
36103594
assert!(v.is_empty());
3611-
assert!(v.is_zero());
36123595
}}
36133596
);
36143597

branches/try/src/test/run-pass/deriving-zero.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ struct Lots {
2929
e: char,
3030
f: float,
3131
g: (f32, char),
32-
h: ~[util::NonCopyable],
33-
i: @mut (int, int),
34-
j: bool,
35-
k: (),
32+
h: @mut (int, int),
33+
i: bool,
34+
j: (),
3635
}
3736

3837
fn main() {

0 commit comments

Comments
 (0)