From e0ede9c6b3894851b800a323757857eba07943b5 Mon Sep 17 00:00:00 2001 From: Aaron Turon Date: Thu, 10 Jul 2014 14:19:17 -0700 Subject: Stabilization for `owned` (now `boxed`) and `cell` This PR is the outcome of the library stabilization meeting for the `liballoc::owned` and `libcore::cell` modules. Aside from the stability attributes, there are a few breaking changes: * The `owned` modules is now named `boxed`, to better represent its contents. (`box` was unavailable, since it's a keyword.) This will help avoid the misconception that `Box` plays a special role wrt ownership. * The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move` method is renamed to `downcast`, in both cases to improve clarity. * The recently-added `AnySendOwnExt` extension trait is removed; it was not being used and is unnecessary. [breaking-change] --- src/libstd/task.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libstd/task.rs') diff --git a/src/libstd/task.rs b/src/libstd/task.rs index 72cc596085e..d7af92024eb 100644 --- a/src/libstd/task.rs +++ b/src/libstd/task.rs @@ -98,7 +98,7 @@ use comm::channel; use io::{Writer, stdio}; use kinds::{Send, marker}; use option::{None, Some, Option}; -use owned::Box; +use boxed::Box; use result::Result; use rt::local::Local; use rt::task; @@ -374,7 +374,7 @@ pub fn failing() -> bool { #[cfg(test)] mod test { use any::{Any, AnyRefExt}; - use owned::AnyOwnExt; + use boxed::BoxAny; use result; use result::{Ok, Err}; use str::StrAllocating; @@ -578,7 +578,7 @@ mod test { Err(e) => { type T = &'static str; assert!(e.is::()); - assert_eq!(*e.move::().unwrap(), "static string"); + assert_eq!(*e.downcast::().unwrap(), "static string"); } Ok(()) => fail!() } @@ -592,7 +592,7 @@ mod test { Err(e) => { type T = String; assert!(e.is::()); - assert_eq!(*e.move::().unwrap(), "owned string".to_string()); + assert_eq!(*e.downcast::().unwrap(), "owned string".to_string()); } Ok(()) => fail!() } @@ -606,9 +606,9 @@ mod test { Err(e) => { type T = Box; assert!(e.is::()); - let any = e.move::().unwrap(); + let any = e.downcast::().unwrap(); assert!(any.is::()); - assert_eq!(*any.move::().unwrap(), 413u16); + assert_eq!(*any.downcast::().unwrap(), 413u16); } Ok(()) => fail!() } -- cgit 1.4.1-3-g733a5