Skip to content

Commit e84225e

Browse files
committed
---
yaml --- r: 149070 b: refs/heads/try2 c: 06a0c21 h: refs/heads/master v: v3
1 parent 6a84e74 commit e84225e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+316
-358
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 38ed4674e8054ee854871303401bffed7c05b01b
8+
refs/heads/try2: 06a0c21c91b161781ee1aced0f2a9aed84cb4646
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ ifdef TRACE
126126
endif
127127
ifdef CFG_DISABLE_RPATH
128128
# NOTE: make this CFG_RUSTC_FLAGS after stage0 snapshot
129-
RUSTFLAGS_STAGE1 += -C no-rpath
130-
RUSTFLAGS_STAGE2 += -C no-rpath
131-
RUSTFLAGS_STAGE3 += -C no-rpath
129+
RUSTFLAGS_STAGE1 += --no-rpath
130+
RUSTFLAGS_STAGE2 += --no-rpath
131+
RUSTFLAGS_STAGE3 += --no-rpath
132132
endif
133133

134134
# The executables crated during this compilation process have no need to include

branches/try2/src/libarena/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ use std::rc::Rc;
4040
use std::rt::global_heap;
4141
use std::unstable::intrinsics::{TyDesc, get_tydesc};
4242
use std::unstable::intrinsics;
43+
use std::util;
4344
use std::vec;
4445

4546
// The way arena uses arrays is really deeply awful. The arrays are
@@ -403,7 +404,7 @@ impl TypedArenaChunk {
403404
}
404405

405406
// Destroy the next chunk.
406-
let next_opt = mem::replace(&mut self.next, None);
407+
let next_opt = util::replace(&mut self.next, None);
407408
match next_opt {
408409
None => {}
409410
Some(mut next) => {

branches/try2/src/libcollections/dlist.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
// the reverse direction.
2424

2525
use std::cast;
26-
use std::mem::{replace, swap};
2726
use std::ptr;
27+
use std::util;
2828
use std::iter::Rev;
2929
use std::iter;
3030

@@ -102,7 +102,7 @@ impl<T> Rawlink<T> {
102102

103103
/// Return the `Rawlink` and replace with `Rawlink::none()`
104104
fn take(&mut self) -> Rawlink<T> {
105-
replace(self, Rawlink::none())
105+
util::replace(self, Rawlink::none())
106106
}
107107
}
108108

@@ -161,7 +161,7 @@ impl<T> DList<T> {
161161
Some(ref mut head) => {
162162
new_head.prev = Rawlink::none();
163163
head.prev = Rawlink::some(new_head);
164-
swap(head, &mut new_head);
164+
util::swap(head, &mut new_head);
165165
head.next = Some(new_head);
166166
}
167167
}
@@ -319,7 +319,7 @@ impl<T> DList<T> {
319319
/// O(1)
320320
#[inline]
321321
pub fn prepend(&mut self, mut other: DList<T>) {
322-
swap(self, &mut other);
322+
util::swap(self, &mut other);
323323
self.append(other);
324324
}
325325

branches/try2/src/libcollections/list.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,6 @@ pub fn find<T:Clone>(ls: @List<T>, f: |&T| -> bool) -> Option<T> {
6363
};
6464
}
6565

66-
/**
67-
* Returns true if a list contains an element that matches a given predicate
68-
*
69-
* Apply function `f` to each element of `ls`, starting from the first.
70-
* When function `f` returns true then it also returns true. If `f` matches no
71-
* elements then false is returned.
72-
*/
73-
pub fn any<T>(ls: @List<T>, f: |&T| -> bool) -> bool {
74-
let mut ls = ls;
75-
loop {
76-
ls = match *ls {
77-
Cons(ref hd, tl) => {
78-
if f(hd) { return true; }
79-
tl
80-
}
81-
Nil => return false
82-
}
83-
};
84-
}
85-
8666
/// Returns true if a list contains an element with the given value
8767
pub fn has<T:Eq>(ls: @List<T>, elt: T) -> bool {
8868
let mut found = false;
@@ -242,15 +222,6 @@ mod tests {
242222
assert_eq!(list::find(empty, match_), option::None::<int>);
243223
}
244224

245-
#[test]
246-
fn test_any() {
247-
fn match_(i: &int) -> bool { return *i == 2; }
248-
let l = from_vec([0, 1, 2]);
249-
let empty = @list::Nil::<int>;
250-
assert_eq!(list::any(l, match_), true);
251-
assert_eq!(list::any(empty, match_), false);
252-
}
253-
254225
#[test]
255226
fn test_has() {
256227
let l = from_vec([5, 8, 6]);

branches/try2/src/libcollections/priority_queue.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
#[allow(missing_doc)];
1414

1515
use std::clone::Clone;
16-
use std::mem::{move_val_init, init, replace, swap};
16+
use std::mem::{move_val_init, init};
17+
use std::util::{replace, swap};
1718
use std::vec;
1819

1920
/// A priority queue implemented with a binary heap

branches/try2/src/libcollections/smallintmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#[allow(missing_doc)];
1717

1818
use std::iter::{Enumerate, FilterMap, Rev};
19-
use std::mem::replace;
19+
use std::util::replace;
2020
use std::vec;
2121

2222
#[allow(missing_doc)]

branches/try2/src/libcollections/treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
//! trees. The only requirement for the types is that the key implements
1313
//! `TotalOrd`.
1414
15+
use std::util::{swap, replace};
1516
use std::iter::{Peekable};
1617
use std::cmp::Ordering;
17-
use std::mem::{replace, swap};
1818
use std::ptr;
1919

2020
use serialize::{Encodable, Decodable, Encoder, Decoder};

branches/try2/src/libextra/num/bigint.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,8 +2592,7 @@ mod bigint_tests {
25922592
#[cfg(test)]
25932593
mod bench {
25942594
use super::*;
2595-
use std::iter;
2596-
use std::mem::replace;
2595+
use std::{iter, util};
25972596
use std::num::{FromPrimitive, Zero, One};
25982597
use extra::test::BenchHarness;
25992598

@@ -2610,7 +2609,7 @@ mod bench {
26102609
let mut f1: BigUint = One::one();
26112610
for _ in range(0, n) {
26122611
let f2 = f0 + f1;
2613-
f0 = replace(&mut f1, f2);
2612+
f0 = util::replace(&mut f1, f2);
26142613
}
26152614
f0
26162615
}

branches/try2/src/libextra/stats.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
use std::cmp;
1414
use std::hashmap;
1515
use std::io;
16-
use std::mem;
1716
use std::num;
17+
use std::util;
1818

1919
// NB: this can probably be rewritten in terms of num::Num
2020
// to be less f64-specific.
@@ -178,7 +178,7 @@ impl<'a> Stats for &'a [f64] {
178178
for i in range(0, partials.len()) {
179179
let mut y = partials[i];
180180
if num::abs(x) < num::abs(y) {
181-
mem::swap(&mut x, &mut y);
181+
util::swap(&mut x, &mut y);
182182
}
183183
// Rounded `x+y` is stored in `hi` with round-off stored in
184184
// `lo`. Together `hi+lo` are exactly equal to `x+y`.

0 commit comments

Comments
 (0)