Skip to content

Commit 44804f1

Browse files
committed
---
yaml --- r: 51382 b: refs/heads/incoming c: c3fe0b9 h: refs/heads/master v: v3
1 parent f1fa503 commit 44804f1

File tree

5 files changed

+38
-11
lines changed

5 files changed

+38
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 38ac809cc7f0d4da8cc16951f8a9852f4b052c1f
9+
refs/heads/incoming: c3fe0b97de67e0449aa20cd8ef683fb594bb3ffd
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/iter.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ pub trait ReverseIter<A>: BaseIter<A> {
3131
pure fn each_reverse(&self, blk: &fn(&A) -> bool);
3232
}
3333

34+
pub trait MutableIter<A>: BaseIter<A> {
35+
fn each_mut(&mut self, blk: &fn(&mut A) -> bool);
36+
}
37+
3438
pub trait ExtendedIter<A> {
3539
pure fn eachi(&self, blk: &fn(uint, v: &A) -> bool);
3640
pure fn all(&self, blk: &fn(&A) -> bool) -> bool;

branches/incoming/src/libcore/prelude.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ pub use clone::Clone;
2727
pub use cmp::{Eq, Ord, TotalOrd, Ordering, Less, Equal, Greater};
2828
pub use container::{Container, Mutable, Map, Set};
2929
pub use hash::Hash;
30-
pub use iter::{BaseIter, ReverseIter, ExtendedIter, EqIter, CopyableIter};
31-
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
30+
pub use iter::{BaseIter, ReverseIter, MutableIter, ExtendedIter, EqIter};
31+
pub use iter::{CopyableIter, CopyableOrderedIter, CopyableNonstrictIter};
32+
pub use iter::Times;
3233
pub use num::NumCast;
3334
pub use path::GenericPath;
3435
pub use path::Path;
@@ -43,6 +44,10 @@ pub use vec::{CopyableVector, ImmutableVector};
4344
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
4445
pub use vec::{OwnedVector, OwnedCopyableVector};
4546

47+
/* Reexported runtime types */
48+
pub use comm::{stream, Port, Chan, GenericChan, GenericSmartChan, GenericPort, Peekable};
49+
pub use task::spawn;
50+
4651
/* Reexported modules */
4752

4853
pub use at_vec;

branches/incoming/src/libcore/str.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,7 +2273,6 @@ pub trait StrSlice {
22732273
pure fn to_owned(&self) -> ~str;
22742274
pure fn to_managed(&self) -> @str;
22752275
pure fn char_at(&self, i: uint) -> char;
2276-
fn to_bytes(&self) -> ~[u8];
22772276
}
22782277
22792278
/// Extension methods for strings
@@ -2417,8 +2416,6 @@ impl StrSlice for &self/str {
24172416
24182417
#[inline]
24192418
pure fn char_at(&self, i: uint) -> char { char_at(*self, i) }
2420-
2421-
fn to_bytes(&self) -> ~[u8] { to_bytes(*self) }
24222419
}
24232420
24242421
pub trait OwnedStr {

branches/incoming/src/libcore/vec.rs

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ pub pure fn each<T>(v: &r/[T], f: &fn(&r/T) -> bool) {
13571357
/// a vector with mutable contents and you would like
13581358
/// to mutate the contents as you iterate.
13591359
#[inline(always)]
1360-
pub fn each_mut<T>(v: &mut [T], f: &fn(elem: &mut T) -> bool) {
1360+
pub fn each_mut<T>(v: &'r mut [T], f: &fn(elem: &'r mut T) -> bool) {
13611361
let mut i = 0;
13621362
let n = v.len();
13631363
while i < n {
@@ -2280,11 +2280,9 @@ pub mod bytes {
22802280
// ___________________________________________________________________________
22812281
// ITERATION TRAIT METHODS
22822282

2283-
impl<A> iter::BaseIter<A> for &self/[A] {
2283+
impl<A> iter::BaseIter<A> for &'self [A] {
22842284
#[inline(always)]
2285-
pub pure fn each(&self, blk: &fn(v: &'self A) -> bool) {
2286-
each(*self, blk)
2287-
}
2285+
pure fn each(&self, blk: &fn(v: &'self A) -> bool) { each(*self, blk) }
22882286
#[inline(always)]
22892287
pure fn size_hint(&self) -> Option<uint> { Some(self.len()) }
22902288
}
@@ -2305,6 +2303,29 @@ impl<A> iter::BaseIter<A> for @[A] {
23052303
pure fn size_hint(&self) -> Option<uint> { Some(self.len()) }
23062304
}
23072305

2306+
impl<A> iter::MutableIter<A> for &'self mut [A] {
2307+
#[inline(always)]
2308+
fn each_mut(&mut self, blk: &fn(v: &'self mut A) -> bool) {
2309+
each_mut(*self, blk)
2310+
}
2311+
}
2312+
2313+
// FIXME(#4148): This should be redundant
2314+
impl<A> iter::MutableIter<A> for ~[A] {
2315+
#[inline(always)]
2316+
fn each_mut(&mut self, blk: &fn(v: &'self mut A) -> bool) {
2317+
each_mut(*self, blk)
2318+
}
2319+
}
2320+
2321+
// FIXME(#4148): This should be redundant
2322+
impl<A> iter::MutableIter<A> for @mut [A] {
2323+
#[inline(always)]
2324+
fn each_mut(&mut self, blk: &fn(v: &mut A) -> bool) {
2325+
each_mut(*self, blk)
2326+
}
2327+
}
2328+
23082329
impl<A> iter::ExtendedIter<A> for &self/[A] {
23092330
pub pure fn eachi(&self, blk: &fn(uint, v: &A) -> bool) {
23102331
iter::eachi(self, blk)

0 commit comments

Comments
 (0)