From cbc31df4fc084b47a5c6456df2efb6e28b82a7da Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 13 May 2014 14:58:29 -0700 Subject: std: Move the owned module from core to std The compiler was updated to recognize that implementations for ty_uniq(..) are allowed if the Box lang item is located in the current crate. This enforces the idea that libcore cannot allocated, and moves all related trait implementations from libcore to libstd. This is a breaking change in that the AnyOwnExt trait has moved from the any module to the owned module. Any previous users of std::any::AnyOwnExt should now use std::owned::AnyOwnExt instead. This was done because the trait is intended for Box traits and only Box traits. [breaking-change] --- src/libcore/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libcore/lib.rs') diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 06bd46fe9ad..97b086a093d 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -30,7 +30,6 @@ #[cfg(test)] pub use cmp = realcore::cmp; #[cfg(test)] pub use kinds = realcore::kinds; #[cfg(test)] pub use ops = realcore::ops; -#[cfg(test)] pub use owned = realcore::owned; #[cfg(test)] pub use ty = realcore::ty; #[cfg(not(test))] @@ -73,7 +72,6 @@ pub mod ptr; #[cfg(not(test))] pub mod ops; #[cfg(not(test))] pub mod ty; #[cfg(not(test))] pub mod cmp; -#[cfg(not(test))] pub mod owned; pub mod clone; pub mod default; pub mod container; @@ -95,6 +93,9 @@ pub mod slice; pub mod str; pub mod tuple; +#[cfg(stage0, not(test))] +pub mod owned; + mod failure; // FIXME: this module should not exist. Once owned allocations are no longer a -- cgit 1.4.1-3-g733a5