Skip to content

Commit b03279a

Browse files
committed
inline Box::new always.
(You shouldn't use it, but it is a semi-reasonable way to annotate types when necessary.)
1 parent 270f0ee commit b03279a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/liballoc/boxed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ impl<T> Box<T> {
9494
/// let x = Box::new(5);
9595
/// ```
9696
#[stable(feature = "rust1", since = "1.0.0")]
97+
#[inline(always)]
9798
pub fn new(x: T) -> Box<T> {
9899
box x
99100
}

0 commit comments

Comments
 (0)