@@ -283,9 +283,7 @@ impl<T> Box<T> {
283
283
#[ must_use]
284
284
#[ inline( always) ]
285
285
pub fn pin ( x : T ) -> Pin < Box < T > > {
286
- ( #[ rustc_box]
287
- Box :: new ( x) )
288
- . into ( )
286
+ Box :: new ( x) . into ( )
289
287
}
290
288
291
289
/// Allocates memory on the heap then places `x` into it,
@@ -1242,8 +1240,8 @@ unsafe impl<#[may_dangle] T: ?Sized, A: Allocator> Drop for Box<T, A> {
1242
1240
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1243
1241
impl < T : Default > Default for Box < T > {
1244
1242
/// Creates a `Box<T>`, with the `Default` value for T.
1243
+ #[ inline]
1245
1244
fn default ( ) -> Self {
1246
- #[ rustc_box]
1247
1245
Box :: new ( T :: default ( ) )
1248
1246
}
1249
1247
}
@@ -1252,6 +1250,7 @@ impl<T: Default> Default for Box<T> {
1252
1250
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1253
1251
#[ rustc_const_unstable( feature = "const_default_impls" , issue = "87864" ) ]
1254
1252
impl < T > const Default for Box < [ T ] > {
1253
+ #[ inline]
1255
1254
fn default ( ) -> Self {
1256
1255
let ptr: Unique < [ T ] > = Unique :: < [ T ; 0 ] > :: dangling ( ) ;
1257
1256
Box ( ptr, Global )
@@ -1262,6 +1261,7 @@ impl<T> const Default for Box<[T]> {
1262
1261
#[ stable( feature = "default_box_extra" , since = "1.17.0" ) ]
1263
1262
#[ rustc_const_unstable( feature = "const_default_impls" , issue = "87864" ) ]
1264
1263
impl const Default for Box < str > {
1264
+ #[ inline]
1265
1265
fn default ( ) -> Self {
1266
1266
// SAFETY: This is the same as `Unique::cast<U>` but with an unsized `U = str`.
1267
1267
let ptr: Unique < str > = unsafe {
@@ -1616,7 +1616,6 @@ impl<T, const N: usize> From<[T; N]> for Box<[T]> {
1616
1616
/// println!("{boxed:?}");
1617
1617
/// ```
1618
1618
fn from ( array : [ T ; N ] ) -> Box < [ T ] > {
1619
- #[ rustc_box]
1620
1619
Box :: new ( array)
1621
1620
}
1622
1621
}
0 commit comments