diff options
Diffstat (limited to 'src/liballoc/boxed.rs')
| -rw-r--r-- | src/liballoc/boxed.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index a93872dfe36..630ca837daa 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -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 } @@ -156,7 +157,7 @@ impl<T: Default> Default for Box<T> { #[stable(feature = "rust1", since = "1.0.0")] impl<T> Default for Box<[T]> { #[stable(feature = "rust1", since = "1.0.0")] - fn default() -> Box<[T]> { box [] } + fn default() -> Box<[T]> { Box::<[T; 0]>::new([]) } } #[stable(feature = "rust1", since = "1.0.0")] |
