@@ -150,16 +150,13 @@ use core::any::Any;
150150use core:: async_iter:: AsyncIterator ;
151151use core:: borrow;
152152use core:: cmp:: Ordering ;
153- use core:: convert:: { From , TryFrom } ;
154153use core:: error:: Error ;
155154use core:: fmt;
156155use core:: future:: Future ;
157156use core:: hash:: { Hash , Hasher } ;
158- #[ cfg( not( no_global_oom_handling) ) ]
159- use core:: iter:: FromIterator ;
160- use core:: iter:: { FusedIterator , Iterator } ;
157+ use core:: iter:: FusedIterator ;
161158use core:: marker:: Tuple ;
162- use core:: marker:: { Unpin , Unsize } ;
159+ use core:: marker:: Unsize ;
163160use core:: mem;
164161use core:: ops:: {
165162 CoerceUnsized , Deref , DerefMut , DispatchFromDyn , Generator , GeneratorState , Receiver ,
@@ -579,8 +576,7 @@ impl<T, A: Allocator> Box<T, A> {
579576 ///
580577 /// This conversion does not allocate on the heap and happens in place.
581578 #[ unstable( feature = "box_into_boxed_slice" , issue = "71582" ) ]
582- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
583- pub const fn into_boxed_slice ( boxed : Self ) -> Box < [ T ] , A > {
579+ pub fn into_boxed_slice ( boxed : Self ) -> Box < [ T ] , A > {
584580 let ( raw, alloc) = Box :: into_raw_with_allocator ( boxed) ;
585581 unsafe { Box :: from_raw_in ( raw as * mut [ T ; 1 ] , alloc) }
586582 }
@@ -812,9 +808,8 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
812808 /// assert_eq!(*five, 5)
813809 /// ```
814810 #[ unstable( feature = "new_uninit" , issue = "63291" ) ]
815- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
816811 #[ inline]
817- pub const unsafe fn assume_init ( self ) -> Box < T , A > {
812+ pub unsafe fn assume_init ( self ) -> Box < T , A > {
818813 let ( raw, alloc) = Box :: into_raw_with_allocator ( self ) ;
819814 unsafe { Box :: from_raw_in ( raw as * mut T , alloc) }
820815 }
@@ -847,9 +842,8 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
847842 /// }
848843 /// ```
849844 #[ unstable( feature = "new_uninit" , issue = "63291" ) ]
850- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
851845 #[ inline]
852- pub const fn write ( mut boxed : Self , value : T ) -> Box < T , A > {
846+ pub fn write ( mut boxed : Self , value : T ) -> Box < T , A > {
853847 unsafe {
854848 ( * boxed) . write ( value) ;
855849 boxed. assume_init ( )
@@ -1093,9 +1087,8 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
10931087 ///
10941088 /// [memory layout]: self#memory-layout
10951089 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
1096- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
10971090 #[ inline]
1098- pub const fn into_raw_with_allocator ( b : Self ) -> ( * mut T , A ) {
1091+ pub fn into_raw_with_allocator ( b : Self ) -> ( * mut T , A ) {
10991092 let ( leaked, alloc) = Box :: into_unique ( b) ;
11001093 ( leaked. as_ptr ( ) , alloc)
11011094 }
@@ -1105,10 +1098,9 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
11051098 issue = "none" ,
11061099 reason = "use `Box::leak(b).into()` or `Unique::from(Box::leak(b))` instead"
11071100 ) ]
1108- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
11091101 #[ inline]
11101102 #[ doc( hidden) ]
1111- pub const fn into_unique ( b : Self ) -> ( Unique < T > , A ) {
1103+ pub fn into_unique ( b : Self ) -> ( Unique < T > , A ) {
11121104 // Box is recognized as a "unique pointer" by Stacked Borrows, but internally it is a
11131105 // raw pointer for the type system. Turning it directly into a raw pointer would not be
11141106 // recognized as "releasing" the unique pointer to permit aliased raw accesses,
@@ -1166,9 +1158,8 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
11661158 /// assert_eq!(*static_ref, [4, 2, 3]);
11671159 /// ```
11681160 #[ stable( feature = "box_leak" , since = "1.26.0" ) ]
1169- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
11701161 #[ inline]
1171- pub const fn leak < ' a > ( b : Self ) -> & ' a mut T
1162+ pub fn leak < ' a > ( b : Self ) -> & ' a mut T
11721163 where
11731164 A : ' a ,
11741165 {
@@ -1237,8 +1228,7 @@ impl<T: Default> Default for Box<T> {
12371228
12381229#[ cfg( not( no_global_oom_handling) ) ]
12391230#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1240- #[ rustc_const_unstable( feature = "const_default_impls" , issue = "87864" ) ]
1241- impl < T > const Default for Box < [ T ] > {
1231+ impl < T > Default for Box < [ T ] > {
12421232 #[ inline]
12431233 fn default ( ) -> Self {
12441234 let ptr: Unique < [ T ] > = Unique :: < [ T ; 0 ] > :: dangling ( ) ;
@@ -1248,8 +1238,7 @@ impl<T> const Default for Box<[T]> {
12481238
12491239#[ cfg( not( no_global_oom_handling) ) ]
12501240#[ stable( feature = "default_box_extra" , since = "1.17.0" ) ]
1251- #[ rustc_const_unstable( feature = "const_default_impls" , issue = "87864" ) ]
1252- impl const Default for Box < str > {
1241+ impl Default for Box < str > {
12531242 #[ inline]
12541243 fn default ( ) -> Self {
12551244 // SAFETY: This is the same as `Unique::cast<U>` but with an unsized `U = str`.
@@ -1446,8 +1435,7 @@ impl<T> From<T> for Box<T> {
14461435}
14471436
14481437#[ stable( feature = "pin" , since = "1.33.0" ) ]
1449- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
1450- 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 > >
14511439where
14521440 A : ' static ,
14531441{
@@ -1883,8 +1871,7 @@ impl<T: ?Sized, A: Allocator> fmt::Pointer for Box<T, A> {
18831871}
18841872
18851873#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1886- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
1887- impl < T : ?Sized , A : Allocator > const Deref for Box < T , A > {
1874+ impl < T : ?Sized , A : Allocator > Deref for Box < T , A > {
18881875 type Target = T ;
18891876
18901877 fn deref ( & self ) -> & T {
@@ -1893,8 +1880,7 @@ impl<T: ?Sized, A: Allocator> const Deref for Box<T, A> {
18931880}
18941881
18951882#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1896- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
1897- impl < T : ?Sized , A : Allocator > const DerefMut for Box < T , A > {
1883+ impl < T : ?Sized , A : Allocator > DerefMut for Box < T , A > {
18981884 fn deref_mut ( & mut self ) -> & mut T {
18991885 & mut * * self
19001886 }
0 commit comments