Add Box::new method. Prereq for feature-gating box <expr> itself.

This commit is contained in:
Felix S. Klock II 2015-01-07 01:10:50 +01:00
parent 9f1ead8fad
commit 82af2a1847

View File

@ -49,6 +49,15 @@ pub static HEAP: () = ();
#[stable]
pub struct Box<T>(Unique<T>);
#[unstable]
impl<T> Box<T> {
/// Moves `x` into a freshly allocated box on the global exchange heap.
#[unstable]
pub fn new(x: T) -> Box<T> {
box x
}
}
#[stable]
impl<T: Default> Default for Box<T> {
#[stable]