about summary refs log tree commit diff
path: root/src/libstd/sync.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-02-26 11:32:00 -0800
committerPatrick Walton <pcwalton@mimiga.net>2013-02-27 09:40:15 -0800
commit8d7e6ef7725f8a11de940892a74398fc1911dfc7 (patch)
tree44e7cd64fac348be5c823db76cdd9a0738c3074d /src/libstd/sync.rs
parent061a2237230d3abcdb30ecb8987e5de17e67a58e (diff)
downloadrust-8d7e6ef7725f8a11de940892a74398fc1911dfc7.tar.gz
rust-8d7e6ef7725f8a11de940892a74398fc1911dfc7.zip
libsyntax: Forbid `~mut` and `~const`. rs=demuting
Diffstat (limited to 'src/libstd/sync.rs')
-rw-r--r--src/libstd/sync.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs
index 016847a5bfd..1ff51e8bff0 100644
--- a/src/libstd/sync.rs
+++ b/src/libstd/sync.rs
@@ -15,6 +15,7 @@
  * in std.
  */
 
+use core::cell::Cell;
 use core::option;
 use core::pipes;
 use core::prelude::*;
@@ -799,9 +800,9 @@ mod tests {
             let s = ~semaphore(1);
             let s2 = ~s.clone();
             let (p,c) = comm::stream();
-            let child_data = ~mut Some((s2, c));
+            let child_data = Cell((s2, c));
             do s.access {
-                let (s2,c) = option::swap_unwrap(child_data);
+                let (s2, c) = child_data.take();
                 do task::spawn || {
                     c.send(());
                     do s2.access { }
@@ -976,13 +977,13 @@ mod tests {
             let mut sibling_convos = ~[];
             for 2.times {
                 let (p,c) = comm::stream();
-                let c = ~mut Some(c);
+                let c = Cell(c);
                 sibling_convos.push(p);
                 let mi = ~m2.clone();
                 // spawn sibling task
-                do task::spawn || { // linked
+                do task::spawn { // linked
                     do mi.lock_cond |cond| {
-                        let c = option::swap_unwrap(c);
+                        let c = c.take();
                         c.send(()); // tell sibling to go ahead
                         let _z = SendOnFailure(c);
                         cond.wait(); // block forever