about summary refs log tree commit diff
path: root/src/libsync
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-05-05 18:56:44 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-05-06 23:12:54 -0700
commit090040bf4037a094e50b03d79e4baf5cd89c912b (patch)
tree27fa91d623889d59260d3db167abdfa8c4288849 /src/libsync
parent24f6f26e633e50b5b59f9d0f6cca0b1e49e215d9 (diff)
downloadrust-090040bf4037a094e50b03d79e4baf5cd89c912b.tar.gz
rust-090040bf4037a094e50b03d79e4baf5cd89c912b.zip
librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box<self>` before the snapshot.

How to update your code:

* Instead of `~EXPR`, you should write `box EXPR`.

* Instead of `~TYPE`, you should write `Box<Type>`.

* Instead of `~PATTERN`, you should write `box PATTERN`.

[breaking-change]
Diffstat (limited to 'src/libsync')
-rw-r--r--src/libsync/mutex.rs8
-rw-r--r--src/libsync/raw.rs8
2 files changed, 9 insertions, 7 deletions
diff --git a/src/libsync/mutex.rs b/src/libsync/mutex.rs
index e41484c46bd..54c3a9c77f8 100644
--- a/src/libsync/mutex.rs
+++ b/src/libsync/mutex.rs
@@ -208,7 +208,7 @@ impl StaticMutex {
         // After we've failed the fast path, then we delegate to the differnet
         // locking protocols for green/native tasks. This will select two tasks
         // to continue further (one native, one green).
-        let t: ~Task = Local::take();
+        let t: Box<Task> = Local::take();
         let can_block = t.can_block();
         let native_bit;
         if can_block {
@@ -244,7 +244,7 @@ impl StaticMutex {
         // regularly in native/green contention. Due to try_lock and the header
         // of lock stealing the lock, it's also possible for native/native
         // contention to hit this location, but as less common.
-        let t: ~Task = Local::take();
+        let t: Box<Task> = Local::take();
         t.deschedule(1, |task| {
             let task = unsafe { task.cast_to_uint() };
 
@@ -308,7 +308,7 @@ impl StaticMutex {
 
     // Tasks which can block are super easy. These tasks just call the blocking
     // `lock()` function on an OS mutex
-    fn native_lock(&self, t: ~Task) {
+    fn native_lock(&self, t: Box<Task>) {
         Local::put(t);
         unsafe { self.lock.lock_noguard(); }
     }
@@ -317,7 +317,7 @@ impl StaticMutex {
         unsafe { self.lock.unlock_noguard(); }
     }
 
-    fn green_lock(&self, t: ~Task) {
+    fn green_lock(&self, t: Box<Task>) {
         // Green threads flag their presence with an atomic counter, and if they
         // fail to be the first to the mutex, they enqueue themselves on a
         // concurrent internal queue with a stack-allocated node.
diff --git a/src/libsync/raw.rs b/src/libsync/raw.rs
index 6ab833a19ef..313720fa932 100644
--- a/src/libsync/raw.rs
+++ b/src/libsync/raw.rs
@@ -167,7 +167,9 @@ impl<Q: Send> Sem<Q> {
 #[unsafe_destructor]
 impl<Q: Send> Drop for Sem<Q> {
     fn drop(&mut self) {
-        let _waiters: ~SemInner<Q> = unsafe { cast::transmute(self.inner) };
+        let _waiters: Box<SemInner<Q>> = unsafe {
+            cast::transmute(self.inner)
+        };
         self.inner = 0 as *();
     }
 }
@@ -835,7 +837,7 @@ mod tests {
         let m = Arc::new(Mutex::new());
         let m2 = m.clone();
 
-        let result: result::Result<(), ~Any:Send> = task::try(proc() {
+        let result: result::Result<(), Box<Any:Send>> = task::try(proc() {
             let _lock = m2.lock();
             fail!();
         });
@@ -1075,7 +1077,7 @@ mod tests {
         let x = Arc::new(RWLock::new());
         let x2 = x.clone();
 
-        let result: result::Result<(), ~Any:Send> = task::try(proc() {
+        let result: result::Result<(), Box<Any:Send>> = task::try(proc() {
             lock_rwlock_in_mode(&x2, mode1, || {
                 fail!();
             })