Skip to content

Commit f0bf005

Browse files
committed
---
yaml --- r: 108959 b: refs/heads/dist-snap c: da19563 h: refs/heads/master i: 108957: e075a8d 108955: 496d77b 108951: 3975f8d 108943: 9863211 108927: a27c7e4 v: v3
1 parent 3d06dc1 commit f0bf005

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 397abb7242b7d2d3e14a3a11b1ec8b5dadeea06f
9+
refs/heads/dist-snap: da19563dbce08e2a78720010fe458007baa3703a
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libstd/vec_ng.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,26 @@ impl<T> Vec<T> {
6464
xs
6565
}
6666
}
67+
68+
/**
69+
* Partitions the vector into two vectors `(A,B)`, where all
70+
* elements of `A` satisfy `f` and all elements of `B` do not.
71+
*/
72+
#[inline]
73+
pub fn partition(self, f: |&T| -> bool) -> (Vec<T>, Vec<T>) {
74+
let mut lefts = Vec::new();
75+
let mut rights = Vec::new();
76+
77+
for elt in self.move_iter() {
78+
if f(&elt) {
79+
lefts.push(elt);
80+
} else {
81+
rights.push(elt);
82+
}
83+
}
84+
85+
(lefts, rights)
86+
}
6787
}
6888

6989
impl<T: Clone> Vec<T> {

branches/dist-snap/src/test/debug-info/limited-debuginfo.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
// Make sure functions have proper names
1616
// debugger:info functions
17-
// check:static void [...]main();
18-
// check:static void [...]some_function();
19-
// check:static void [...]some_other_function();
20-
// check:static void [...]zzz();
17+
// check:static void limited-debuginfo::main();
18+
// check:static void limited-debuginfo::some_function();
19+
// check:static void limited-debuginfo::some_other_function();
20+
// check:static void limited-debuginfo::zzz();
2121

2222
// debugger:rbreak zzz
2323
// debugger:run
@@ -49,4 +49,4 @@ fn some_function(a: int, b: int) {
4949
zzz();
5050
}
5151

52-
fn some_other_function(a: int, b: int) -> bool { true }
52+
fn some_other_function(a: int, b: int) -> bool { true }

0 commit comments

Comments
 (0)