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]
This commit is contained in:
@@ -10,8 +10,6 @@
|
||||
|
||||
//! The `Default` trait for types which may have meaningful default values
|
||||
|
||||
use owned::Box;
|
||||
|
||||
/// A trait that types which have a useful default value should implement.
|
||||
pub trait Default {
|
||||
/// Return the "default value" for a type.
|
||||
@@ -21,7 +19,3 @@ pub trait Default {
|
||||
impl<T: Default + 'static> Default for @T {
|
||||
fn default() -> @T { @Default::default() }
|
||||
}
|
||||
|
||||
impl<T: Default> Default for Box<T> {
|
||||
fn default() -> Box<T> { box Default::default() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user