diff options
| author | bors <bors@rust-lang.org> | 2014-07-13 21:01:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-07-13 21:01:28 +0000 |
| commit | ffd9966c79ad034fe16e66e6c6795473473a6f50 (patch) | |
| tree | e50643ce8f24f411e120b8e1381b026d5d9fadc2 /src/libstd/task.rs | |
| parent | 7a6208f2cc1bbe29dc42b21d27e98894b8bacc04 (diff) | |
| parent | e0ede9c6b3894851b800a323757857eba07943b5 (diff) | |
| download | rust-ffd9966c79ad034fe16e66e6c6795473473a6f50.tar.gz rust-ffd9966c79ad034fe16e66e6c6795473473a6f50.zip | |
auto merge of #15591 : aturon/rust/box-cell-stability, r=alexcrichton
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]
Diffstat (limited to 'src/libstd/task.rs')
| -rw-r--r-- | src/libstd/task.rs | 12 |
1 files changed, 6 insertions, 6 deletions
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::<T>()); - assert_eq!(*e.move::<T>().unwrap(), "static string"); + assert_eq!(*e.downcast::<T>().unwrap(), "static string"); } Ok(()) => fail!() } @@ -592,7 +592,7 @@ mod test { Err(e) => { type T = String; assert!(e.is::<T>()); - assert_eq!(*e.move::<T>().unwrap(), "owned string".to_string()); + assert_eq!(*e.downcast::<T>().unwrap(), "owned string".to_string()); } Ok(()) => fail!() } @@ -606,9 +606,9 @@ mod test { Err(e) => { type T = Box<Any + Send>; assert!(e.is::<T>()); - let any = e.move::<T>().unwrap(); + let any = e.downcast::<T>().unwrap(); assert!(any.is::<u16>()); - assert_eq!(*any.move::<u16>().unwrap(), 413u16); + assert_eq!(*any.downcast::<u16>().unwrap(), 413u16); } Ok(()) => fail!() } |
