1
Fork 0

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:
Felix S. Klock II 2015-02-16 11:53:29 +01:00
parent 270f0eef73
commit b03279aaa2

View file

@ -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
}