diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index d46f18abf97..cec49fa6186 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -49,6 +49,15 @@ pub static HEAP: () = (); #[stable] pub struct Box(Unique); +#[unstable] +impl Box { + /// Moves `x` into a freshly allocated box on the global exchange heap. + #[unstable] + pub fn new(x: T) -> Box { + box x + } +} + #[stable] impl Default for Box { #[stable]