@@ -283,9 +283,7 @@ impl<T> Box<T> {
283283 #[ must_use]
284284 #[ inline( always) ]
285285 pub fn pin ( x : T ) -> Pin < Box < T > > {
286- ( #[ rustc_box]
287- Box :: new ( x) )
288- . into ( )
286+ Box :: new ( x) . into ( )
289287 }
290288
291289 /// 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> {
12421240#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12431241impl < T : Default > Default for Box < T > {
12441242 /// Creates a `Box<T>`, with the `Default` value for T.
1243+ #[ inline]
12451244 fn default ( ) -> Self {
1246- #[ rustc_box]
12471245 Box :: new ( T :: default ( ) )
12481246 }
12491247}
@@ -1252,6 +1250,7 @@ impl<T: Default> Default for Box<T> {
12521250#[ stable( feature = "rust1" , since = "1.0.0" ) ]
12531251#[ rustc_const_unstable( feature = "const_default_impls" , issue = "87864" ) ]
12541252impl < T > const Default for Box < [ T ] > {
1253+ #[ inline]
12551254 fn default ( ) -> Self {
12561255 let ptr: Unique < [ T ] > = Unique :: < [ T ; 0 ] > :: dangling ( ) ;
12571256 Box ( ptr, Global )
@@ -1262,6 +1261,7 @@ impl<T> const Default for Box<[T]> {
12621261#[ stable( feature = "default_box_extra" , since = "1.17.0" ) ]
12631262#[ rustc_const_unstable( feature = "const_default_impls" , issue = "87864" ) ]
12641263impl const Default for Box < str > {
1264+ #[ inline]
12651265 fn default ( ) -> Self {
12661266 // SAFETY: This is the same as `Unique::cast<U>` but with an unsized `U = str`.
12671267 let ptr: Unique < str > = unsafe {
@@ -1616,7 +1616,6 @@ impl<T, const N: usize> From<[T; N]> for Box<[T]> {
16161616 /// println!("{boxed:?}");
16171617 /// ```
16181618 fn from ( array : [ T ; N ] ) -> Box < [ T ] > {
1619- #[ rustc_box]
16201619 Box :: new ( array)
16211620 }
16221621}
0 commit comments