about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/liballoc/boxed.rs9
1 files changed, 9 insertions, 0 deletions
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<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]