@@ -576,8 +576,7 @@ impl<T, A: Allocator> Box<T, A> {
576
576
///
577
577
/// This conversion does not allocate on the heap and happens in place.
578
578
#[ unstable( feature = "box_into_boxed_slice" , issue = "71582" ) ]
579
- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
580
- pub const fn into_boxed_slice ( boxed : Self ) -> Box < [ T ] , A > {
579
+ pub fn into_boxed_slice ( boxed : Self ) -> Box < [ T ] , A > {
581
580
let ( raw, alloc) = Box :: into_raw_with_allocator ( boxed) ;
582
581
unsafe { Box :: from_raw_in ( raw as * mut [ T ; 1 ] , alloc) }
583
582
}
@@ -809,9 +808,8 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
809
808
/// assert_eq!(*five, 5)
810
809
/// ```
811
810
#[ unstable( feature = "new_uninit" , issue = "63291" ) ]
812
- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
813
811
#[ inline]
814
- pub const unsafe fn assume_init ( self ) -> Box < T , A > {
812
+ pub unsafe fn assume_init ( self ) -> Box < T , A > {
815
813
let ( raw, alloc) = Box :: into_raw_with_allocator ( self ) ;
816
814
unsafe { Box :: from_raw_in ( raw as * mut T , alloc) }
817
815
}
@@ -844,9 +842,8 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
844
842
/// }
845
843
/// ```
846
844
#[ unstable( feature = "new_uninit" , issue = "63291" ) ]
847
- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
848
845
#[ inline]
849
- pub const fn write ( mut boxed : Self , value : T ) -> Box < T , A > {
846
+ pub fn write ( mut boxed : Self , value : T ) -> Box < T , A > {
850
847
unsafe {
851
848
( * boxed) . write ( value) ;
852
849
boxed. assume_init ( )
@@ -1090,9 +1087,8 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
1090
1087
///
1091
1088
/// [memory layout]: self#memory-layout
1092
1089
#[ unstable( feature = "allocator_api" , issue = "32838" ) ]
1093
- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
1094
1090
#[ inline]
1095
- pub const fn into_raw_with_allocator ( b : Self ) -> ( * mut T , A ) {
1091
+ pub fn into_raw_with_allocator ( b : Self ) -> ( * mut T , A ) {
1096
1092
let ( leaked, alloc) = Box :: into_unique ( b) ;
1097
1093
( leaked. as_ptr ( ) , alloc)
1098
1094
}
@@ -1102,10 +1098,9 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
1102
1098
issue = "none" ,
1103
1099
reason = "use `Box::leak(b).into()` or `Unique::from(Box::leak(b))` instead"
1104
1100
) ]
1105
- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
1106
1101
#[ inline]
1107
1102
#[ doc( hidden) ]
1108
- pub const fn into_unique ( b : Self ) -> ( Unique < T > , A ) {
1103
+ pub fn into_unique ( b : Self ) -> ( Unique < T > , A ) {
1109
1104
// Box is recognized as a "unique pointer" by Stacked Borrows, but internally it is a
1110
1105
// raw pointer for the type system. Turning it directly into a raw pointer would not be
1111
1106
// recognized as "releasing" the unique pointer to permit aliased raw accesses,
@@ -1163,9 +1158,8 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
1163
1158
/// assert_eq!(*static_ref, [4, 2, 3]);
1164
1159
/// ```
1165
1160
#[ stable( feature = "box_leak" , since = "1.26.0" ) ]
1166
- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
1167
1161
#[ inline]
1168
- pub const fn leak < ' a > ( b : Self ) -> & ' a mut T
1162
+ pub fn leak < ' a > ( b : Self ) -> & ' a mut T
1169
1163
where
1170
1164
A : ' a ,
1171
1165
{
@@ -1234,8 +1228,7 @@ impl<T: Default> Default for Box<T> {
1234
1228
1235
1229
#[ cfg( not( no_global_oom_handling) ) ]
1236
1230
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1237
- #[ rustc_const_unstable( feature = "const_default_impls" , issue = "87864" ) ]
1238
- impl < T > const Default for Box < [ T ] > {
1231
+ impl < T > Default for Box < [ T ] > {
1239
1232
#[ inline]
1240
1233
fn default ( ) -> Self {
1241
1234
let ptr: Unique < [ T ] > = Unique :: < [ T ; 0 ] > :: dangling ( ) ;
@@ -1245,8 +1238,7 @@ impl<T> const Default for Box<[T]> {
1245
1238
1246
1239
#[ cfg( not( no_global_oom_handling) ) ]
1247
1240
#[ stable( feature = "default_box_extra" , since = "1.17.0" ) ]
1248
- #[ rustc_const_unstable( feature = "const_default_impls" , issue = "87864" ) ]
1249
- impl const Default for Box < str > {
1241
+ impl Default for Box < str > {
1250
1242
#[ inline]
1251
1243
fn default ( ) -> Self {
1252
1244
// SAFETY: This is the same as `Unique::cast<U>` but with an unsized `U = str`.
@@ -1443,8 +1435,7 @@ impl<T> From<T> for Box<T> {
1443
1435
}
1444
1436
1445
1437
#[ stable( feature = "pin" , since = "1.33.0" ) ]
1446
- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
1447
- impl < T : ?Sized , A : Allocator > const From < Box < T , A > > for Pin < Box < T , A > >
1438
+ impl < T : ?Sized , A : Allocator > From < Box < T , A > > for Pin < Box < T , A > >
1448
1439
where
1449
1440
A : ' static ,
1450
1441
{
@@ -1880,8 +1871,7 @@ impl<T: ?Sized, A: Allocator> fmt::Pointer for Box<T, A> {
1880
1871
}
1881
1872
1882
1873
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1883
- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
1884
- impl < T : ?Sized , A : Allocator > const Deref for Box < T , A > {
1874
+ impl < T : ?Sized , A : Allocator > Deref for Box < T , A > {
1885
1875
type Target = T ;
1886
1876
1887
1877
fn deref ( & self ) -> & T {
@@ -1890,8 +1880,7 @@ impl<T: ?Sized, A: Allocator> const Deref for Box<T, A> {
1890
1880
}
1891
1881
1892
1882
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1893
- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
1894
- impl < T : ?Sized , A : Allocator > const DerefMut for Box < T , A > {
1883
+ impl < T : ?Sized , A : Allocator > DerefMut for Box < T , A > {
1895
1884
fn deref_mut ( & mut self ) -> & mut T {
1896
1885
& mut * * self
1897
1886
}
0 commit comments