Add Box::new
method. Prereq for feature-gating box <expr>
itself.
This commit is contained in:
parent
9f1ead8fad
commit
82af2a1847
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user