diff options
| author | bors <bors@rust-lang.org> | 2013-04-28 19:36:36 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-04-28 19:36:36 -0700 |
| commit | 7b7a0fc235cd2e0782302cd6fb83634e190b15b7 (patch) | |
| tree | c4d6aedddc64db81f6ada877e9ec585cf981d2d9 /src/libcore/task | |
| parent | 9f03d45c56b37b36912c16bd5b4fb4723fd91cb7 (diff) | |
| parent | 46f91a0fa95cd13f7433a1d72d087283f483a4b8 (diff) | |
| download | rust-7b7a0fc235cd2e0782302cd6fb83634e190b15b7.tar.gz rust-7b7a0fc235cd2e0782302cd6fb83634e190b15b7.zip | |
auto merge of #6056 : thestinger/rust/iter, r=catamorphism
The existing adaptors like `map` in the `iter` module are very flawed because they only work for `BaseIter` implementations. There are many internal iterator implementations in the standard library like the set methods (`difference`, `symmetric_difference`, `intersection`, `union`) and the `range` functions that only share the `for` loop protocol in common. The internal iterator adaptors should be implemented to work on any implementation of that protocol, rather than just a method called `each` taking `&self`. This just moves `iter.rs` to `old_iter.rs` and begins work on documenting and implementing a nicer module.
Diffstat (limited to 'src/libcore/task')
| -rw-r--r-- | src/libcore/task/mod.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs index a6c03638713..2163a0e325f 100644 --- a/src/libcore/task/mod.rs +++ b/src/libcore/task/mod.rs @@ -687,7 +687,7 @@ fn test_spawn_unlinked_unsup_no_fail_down() { // grandchild sends on a port let ch = ch.clone(); do spawn_unlinked { // Give middle task a chance to fail-but-not-kill-us. - for iter::repeat(16) { task::yield(); } + for old_iter::repeat(16) { task::yield(); } ch.send(()); // If killed first, grandparent hangs. } fail!(); // Shouldn't kill either (grand)parent or (grand)child. @@ -702,7 +702,7 @@ fn test_spawn_unlinked_unsup_no_fail_up() { // child unlinked fails fn test_spawn_unlinked_sup_no_fail_up() { // child unlinked fails do spawn_supervised { fail!(); } // Give child a chance to fail-but-not-kill-us. - for iter::repeat(16) { task::yield(); } + for old_iter::repeat(16) { task::yield(); } } #[test] #[should_fail] #[ignore(cfg(windows))] fn test_spawn_unlinked_sup_fail_down() { @@ -783,7 +783,7 @@ fn test_spawn_failure_propagate_grandchild() { loop { task::yield(); } } } - for iter::repeat(16) { task::yield(); } + for old_iter::repeat(16) { task::yield(); } fail!(); } @@ -795,7 +795,7 @@ fn test_spawn_failure_propagate_secondborn() { loop { task::yield(); } } } - for iter::repeat(16) { task::yield(); } + for old_iter::repeat(16) { task::yield(); } fail!(); } @@ -807,7 +807,7 @@ fn test_spawn_failure_propagate_nephew_or_niece() { loop { task::yield(); } } } - for iter::repeat(16) { task::yield(); } + for old_iter::repeat(16) { task::yield(); } fail!(); } @@ -819,7 +819,7 @@ fn test_spawn_linked_sup_propagate_sibling() { loop { task::yield(); } } } - for iter::repeat(16) { task::yield(); } + for old_iter::repeat(16) { task::yield(); } fail!(); } @@ -971,7 +971,7 @@ fn test_spawn_sched_blocking() { // Testing that a task in one scheduler can block in foreign code // without affecting other schedulers - for iter::repeat(20u) { + for old_iter::repeat(20u) { let (start_po, start_ch) = stream(); let (fin_po, fin_ch) = stream(); @@ -1088,7 +1088,7 @@ fn test_unkillable() { // We want to do this after failing do spawn_unlinked { - for iter::repeat(10) { yield() } + for old_iter::repeat(10) { yield() } ch.send(()); } @@ -1123,7 +1123,7 @@ fn test_unkillable_nested() { // We want to do this after failing do spawn_unlinked || { - for iter::repeat(10) { yield() } + for old_iter::repeat(10) { yield() } ch.send(()); } |
