diff --git a/src/test/bench/msgsend-ring-mutex-arcs.rs b/src/test/bench/msgsend-ring-mutex-arcs.rs index 22045007134..12060a87850 100644 --- a/src/test/bench/msgsend-ring-mutex-arcs.rs +++ b/src/test/bench/msgsend-ring-mutex-arcs.rs @@ -19,6 +19,7 @@ extern mod std; use std::time; use std::arc; use std::future; +use core::cell::Cell; // A poor man's pipe. type pipe = arc::MutexARC<~[uint]>; @@ -77,7 +78,7 @@ fn main() { let msg_per_task = uint::from_str(args[2]).get(); let (num_chan, num_port) = init(); - let mut num_chan = Some(num_chan); + let mut num_chan = Cell(num_chan); let start = time::precise_time_s(); @@ -87,7 +88,7 @@ fn main() { for uint::range(1u, num_tasks) |i| { //error!("spawning %?", i); let (new_chan, num_port) = init(); - let num_chan2 = Cell(num_chan); + let num_chan2 = Cell(num_chan.take()); let num_port = Cell(num_port); let new_future = do future::spawn() { let num_chan = num_chan2.take(); @@ -95,11 +96,11 @@ fn main() { thread_ring(i, msg_per_task, num_chan, num_port1) }; futures.push(new_future); - num_chan = Some(new_chan); + num_chan.put_back(new_chan); }; // do our iteration - thread_ring(0, msg_per_task, option::unwrap(num_chan), num_port); + thread_ring(0, msg_per_task, num_chan.take(), num_port); // synchronize for futures.each |f| { f.get() }; diff --git a/src/test/bench/msgsend-ring-pipes.rs b/src/test/bench/msgsend-ring-pipes.rs index dfe5c6de832..56a46d3e006 100644 --- a/src/test/bench/msgsend-ring-pipes.rs +++ b/src/test/bench/msgsend-ring-pipes.rs @@ -71,7 +71,7 @@ fn main() { let msg_per_task = uint::from_str(args[2]).get(); let (num_chan, num_port) = ring::init(); - let mut num_chan = Some(num_chan); + let mut num_chan = Cell(num_chan); let start = time::precise_time_s(); @@ -81,7 +81,7 @@ fn main() { for uint::range(1u, num_tasks) |i| { //error!("spawning %?", i); let (new_chan, num_port) = ring::init(); - let num_chan2 = Cell(num_chan); + let num_chan2 = Cell(num_chan.take()); let num_port = Cell(num_port); let new_future = do future::spawn || { let num_chan = num_chan2.take(); @@ -89,11 +89,11 @@ fn main() { thread_ring(i, msg_per_task, num_chan, num_port1) }; futures.push(new_future); - num_chan = Some(new_chan); + num_chan.put_back(new_chan); }; // do our iteration - thread_ring(0, msg_per_task, option::unwrap(num_chan), num_port); + thread_ring(0, msg_per_task, num_chan.take(), num_port); // synchronize for futures.each |f| { f.get() }; diff --git a/src/test/bench/msgsend-ring-rw-arcs.rs b/src/test/bench/msgsend-ring-rw-arcs.rs index 98c0129918a..57d04abb414 100644 --- a/src/test/bench/msgsend-ring-rw-arcs.rs +++ b/src/test/bench/msgsend-ring-rw-arcs.rs @@ -16,6 +16,8 @@ // This also serves as a pipes test, because ARCs are implemented with pipes. extern mod std; + +use core::cell::Cell; use std::time; use std::arc; use std::future; @@ -77,7 +79,7 @@ fn main() { let msg_per_task = uint::from_str(args[2]).get(); let (num_chan, num_port) = init(); - let mut num_chan = Some(num_chan); + let mut num_chan = Cell(num_chan); let start = time::precise_time_s(); @@ -87,7 +89,7 @@ fn main() { for uint::range(1u, num_tasks) |i| { //error!("spawning %?", i); let (new_chan, num_port) = init(); - let num_chan2 = Cell(num_chan); + let num_chan2 = Cell(num_chan.take()); let num_port = Cell(num_port); let new_future = do future::spawn { let num_chan = num_chan2.take(); @@ -95,11 +97,11 @@ fn main() { thread_ring(i, msg_per_task, num_chan, num_port1) }; futures.push(new_future); - num_chan = Some(new_chan); + num_chan.put_back(new_chan); }; // do our iteration - thread_ring(0, msg_per_task, option::unwrap(num_chan), num_port); + thread_ring(0, msg_per_task, num_chan.take(), num_port); // synchronize for futures.each |f| { f.get() }; diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index 42a1e4b5046..111219974d0 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -14,7 +14,7 @@ extern mod std; use std::oldmap; use std::oldmap::HashMap; use std::sort; -use std::cell::Cell; +use core::cell::Cell; use core::comm::*; fn print_complements() {