Add Box::new method. Prereq for feature-gating box <expr> itself.
This commit is contained in:
parent
9f1ead8fad
commit
82af2a1847
1 changed files with 9 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue