@@ -159,7 +159,7 @@ use core::hash::{Hash, Hasher};
159159use core:: iter:: FromIterator ;
160160use core:: iter:: { FusedIterator , Iterator } ;
161161use core:: marker:: Tuple ;
162- use core:: marker:: { Destruct , Unpin , Unsize } ;
162+ use core:: marker:: { Unpin , Unsize } ;
163163use core:: mem;
164164use core:: ops:: {
165165 CoerceUnsized , Deref , DerefMut , DispatchFromDyn , Generator , GeneratorState , Receiver ,
@@ -376,12 +376,11 @@ impl<T, A: Allocator> Box<T, A> {
376376 /// ```
377377 #[ cfg( not( no_global_oom_handling) ) ]
378378 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
379- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
380379 #[ must_use]
381380 #[ inline]
382- pub const fn new_in ( x : T , alloc : A ) -> Self
381+ pub fn new_in ( x : T , alloc : A ) -> Self
383382 where
384- A : ~ const Allocator + ~ const Destruct ,
383+ A : Allocator ,
385384 {
386385 let mut boxed = Self :: new_uninit_in ( alloc) ;
387386 unsafe {
@@ -406,12 +405,10 @@ impl<T, A: Allocator> Box<T, A> {
406405 /// # Ok::<(), std::alloc::AllocError>(())
407406 /// ```
408407 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
409- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
410408 #[ inline]
411- pub const fn try_new_in ( x : T , alloc : A ) -> Result < Self , AllocError >
409+ pub fn try_new_in ( x : T , alloc : A ) -> Result < Self , AllocError >
412410 where
413- T : ~const Destruct ,
414- A : ~const Allocator + ~const Destruct ,
411+ A : Allocator ,
415412 {
416413 let mut boxed = Self :: try_new_uninit_in ( alloc) ?;
417414 unsafe {
@@ -441,13 +438,12 @@ impl<T, A: Allocator> Box<T, A> {
441438 /// assert_eq!(*five, 5)
442439 /// ```
443440 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
444- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
445441 #[ cfg( not( no_global_oom_handling) ) ]
446442 #[ must_use]
447443 // #[unstable(feature = "new_uninit", issue = "63291")]
448- pub const fn new_uninit_in ( alloc : A ) -> Box < mem:: MaybeUninit < T > , A >
444+ pub fn new_uninit_in ( alloc : A ) -> Box < mem:: MaybeUninit < T > , A >
449445 where
450- A : ~ const Allocator + ~ const Destruct ,
446+ A : Allocator ,
451447 {
452448 let layout = Layout :: new :: < mem:: MaybeUninit < T > > ( ) ;
453449 // NOTE: Prefer match over unwrap_or_else since closure sometimes not inlineable.
@@ -482,10 +478,9 @@ impl<T, A: Allocator> Box<T, A> {
482478 /// ```
483479 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
484480 // #[unstable(feature = "new_uninit", issue = "63291")]
485- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
486- pub const fn try_new_uninit_in ( alloc : A ) -> Result < Box < mem:: MaybeUninit < T > , A > , AllocError >
481+ pub fn try_new_uninit_in ( alloc : A ) -> Result < Box < mem:: MaybeUninit < T > , A > , AllocError >
487482 where
488- A : ~ const Allocator + ~ const Destruct ,
483+ A : Allocator ,
489484 {
490485 let layout = Layout :: new :: < mem:: MaybeUninit < T > > ( ) ;
491486 let ptr = alloc. allocate ( layout) ?. cast ( ) ;
@@ -513,13 +508,12 @@ impl<T, A: Allocator> Box<T, A> {
513508 ///
514509 /// [zeroed]: mem::MaybeUninit::zeroed
515510 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
516- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
517511 #[ cfg( not( no_global_oom_handling) ) ]
518512 // #[unstable(feature = "new_uninit", issue = "63291")]
519513 #[ must_use]
520- pub const fn new_zeroed_in ( alloc : A ) -> Box < mem:: MaybeUninit < T > , A >
514+ pub fn new_zeroed_in ( alloc : A ) -> Box < mem:: MaybeUninit < T > , A >
521515 where
522- A : ~ const Allocator + ~ const Destruct ,
516+ A : Allocator ,
523517 {
524518 let layout = Layout :: new :: < mem:: MaybeUninit < T > > ( ) ;
525519 // NOTE: Prefer match over unwrap_or_else since closure sometimes not inlineable.
@@ -554,10 +548,9 @@ impl<T, A: Allocator> Box<T, A> {
554548 /// [zeroed]: mem::MaybeUninit::zeroed
555549 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
556550 // #[unstable(feature = "new_uninit", issue = "63291")]
557- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
558- pub const fn try_new_zeroed_in ( alloc : A ) -> Result < Box < mem:: MaybeUninit < T > , A > , AllocError >
551+ pub fn try_new_zeroed_in ( alloc : A ) -> Result < Box < mem:: MaybeUninit < T > , A > , AllocError >
559552 where
560- A : ~ const Allocator + ~ const Destruct ,
553+ A : Allocator ,
561554 {
562555 let layout = Layout :: new :: < mem:: MaybeUninit < T > > ( ) ;
563556 let ptr = alloc. allocate_zeroed ( layout) ?. cast ( ) ;
@@ -573,12 +566,11 @@ impl<T, A: Allocator> Box<T, A> {
573566 /// construct a (pinned) `Box` in a different way than with [`Box::new_in`].
574567 #[ cfg( not( no_global_oom_handling) ) ]
575568 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
576- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
577569 #[ must_use]
578570 #[ inline( always) ]
579- pub const fn pin_in ( x : T , alloc : A ) -> Pin < Self >
571+ pub fn pin_in ( x : T , alloc : A ) -> Pin < Self >
580572 where
581- A : ' static + ~ const Allocator + ~ const Destruct ,
573+ A : ' static + Allocator ,
582574 {
583575 Self :: into_pin ( Self :: new_in ( x, alloc) )
584576 }
@@ -605,12 +597,8 @@ impl<T, A: Allocator> Box<T, A> {
605597 /// assert_eq!(Box::into_inner(c), 5);
606598 /// ```
607599 #[ unstable( feature = "box_into_inner" , issue = "80437" ) ]
608- #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
609600 #[ inline]
610- pub const fn into_inner ( boxed : Self ) -> T
611- where
612- Self : ~const Destruct ,
613- {
601+ pub fn into_inner ( boxed : Self ) -> T {
614602 * boxed
615603 }
616604}
0 commit comments