about summary refs log tree commit diff
path: root/src/libstd/rt/mod.rs
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/libstd/rt/mod.rs
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/libstd/rt/mod.rs')
-rw-r--r--src/libstd/rt/mod.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs
index b407bf8897c..e79e3056838 100644
--- a/src/libstd/rt/mod.rs
+++ b/src/libstd/rt/mod.rs
@@ -57,6 +57,7 @@ Several modules in `core` are clients of `rt`:
 use any::Any;
 use kinds::Send;
 use option::Option;
+use owned::Box;
 use result::Result;
 use task::TaskOpts;
 
@@ -151,22 +152,25 @@ pub static DEFAULT_ERROR_CODE: int = 101;
 pub trait Runtime {
     // Necessary scheduling functions, used for channels and blocking I/O
     // (sometimes).
-    fn yield_now(~self, cur_task: ~Task);
-    fn maybe_yield(~self, cur_task: ~Task);
-    fn deschedule(~self, times: uint, cur_task: ~Task,
+    fn yield_now(~self, cur_task: Box<Task>);
+    fn maybe_yield(~self, cur_task: Box<Task>);
+    fn deschedule(~self, times: uint, cur_task: Box<Task>,
                   f: |BlockedTask| -> Result<(), BlockedTask>);
-    fn reawaken(~self, to_wake: ~Task);
+    fn reawaken(~self, to_wake: Box<Task>);
 
     // Miscellaneous calls which are very different depending on what context
     // you're in.
-    fn spawn_sibling(~self, cur_task: ~Task, opts: TaskOpts, f: proc():Send);
+    fn spawn_sibling(~self,
+                     cur_task: Box<Task>,
+                     opts: TaskOpts,
+                     f: proc():Send);
     fn local_io<'a>(&'a mut self) -> Option<rtio::LocalIo<'a>>;
     /// The (low, high) edges of the current stack.
     fn stack_bounds(&self) -> (uint, uint); // (lo, hi)
     fn can_block(&self) -> bool;
 
     // FIXME: This is a serious code smell and this should not exist at all.
-    fn wrap(~self) -> ~Any;
+    fn wrap(~self) -> Box<Any>;
 }
 
 /// One-time runtime initialization.