inline Box::new
always.
(You shouldn't use it, but it is a semi-reasonable way to annotate types when necessary.)
This commit is contained in:
parent
270f0eef73
commit
b03279aaa2
1 changed files with 1 additions and 0 deletions
|
@ -94,6 +94,7 @@ impl<T> Box<T> {
|
|||
/// let x = Box::new(5);
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline(always)]
|
||||
pub fn new(x: T) -> Box<T> {
|
||||
box x
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue