From 090040bf4037a094e50b03d79e4baf5cd89c912b Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 5 May 2014 18:56:44 -0700 Subject: 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` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change] --- src/libstd/rt/mod.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/libstd/rt/mod.rs') 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); + fn maybe_yield(~self, cur_task: Box); + fn deschedule(~self, times: uint, cur_task: Box, f: |BlockedTask| -> Result<(), BlockedTask>); - fn reawaken(~self, to_wake: ~Task); + fn reawaken(~self, to_wake: Box); // 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, + opts: TaskOpts, + f: proc():Send); fn local_io<'a>(&'a mut self) -> Option>; /// 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; } /// One-time runtime initialization. -- cgit 1.4.1-3-g733a5