@@ -143,7 +143,7 @@ use core::hash::{Hash, Hasher};
143143#[ cfg( not( no_global_oom_handling) ) ]
144144use core:: iter:: FromIterator ;
145145use core:: iter:: { FusedIterator , Iterator } ;
146- use core:: marker:: { Unpin , Unsize } ;
146+ use core:: marker:: { Destruct , Unpin , Unsize } ;
147147use core:: mem;
148148use core:: ops:: {
149149 CoerceUnsized , Deref , DerefMut , DispatchFromDyn , Generator , GeneratorState , Receiver ,
@@ -349,9 +349,10 @@ impl<T, A: Allocator> Box<T, A> {
349349 #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
350350 #[ must_use]
351351 #[ inline]
352+ #[ cfg_attr( not( bootstrap) , allow( drop_bounds) ) ] // FIXME remove `~const Drop` and this attr when bumping
352353 pub const fn new_in ( x : T , alloc : A ) -> Self
353354 where
354- A : ~const Allocator + ~const Drop ,
355+ A : ~const Allocator + ~const Drop + ~ const Destruct ,
355356 {
356357 let mut boxed = Self :: new_uninit_in ( alloc) ;
357358 unsafe {
@@ -378,10 +379,11 @@ impl<T, A: Allocator> Box<T, A> {
378379 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
379380 #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
380381 #[ inline]
382+ #[ cfg_attr( not( bootstrap) , allow( drop_bounds) ) ] // FIXME remove `~const Drop` and this attr when bumping
381383 pub const fn try_new_in ( x : T , alloc : A ) -> Result < Self , AllocError >
382384 where
383- T : ~const Drop ,
384- A : ~const Allocator + ~const Drop ,
385+ T : ~const Drop + ~ const Destruct ,
386+ A : ~const Allocator + ~const Drop + ~ const Destruct ,
385387 {
386388 let mut boxed = Self :: try_new_uninit_in ( alloc) ?;
387389 unsafe {
@@ -415,9 +417,10 @@ impl<T, A: Allocator> Box<T, A> {
415417 #[ cfg( not( no_global_oom_handling) ) ]
416418 #[ must_use]
417419 // #[unstable(feature = "new_uninit", issue = "63291")]
420+ #[ cfg_attr( not( bootstrap) , allow( drop_bounds) ) ] // FIXME remove `~const Drop` and this attr when bumping
418421 pub const fn new_uninit_in ( alloc : A ) -> Box < mem:: MaybeUninit < T > , A >
419422 where
420- A : ~const Allocator + ~const Drop ,
423+ A : ~const Allocator + ~const Drop + ~ const Destruct ,
421424 {
422425 let layout = Layout :: new :: < mem:: MaybeUninit < T > > ( ) ;
423426 // NOTE: Prefer match over unwrap_or_else since closure sometimes not inlineable.
@@ -453,9 +456,10 @@ impl<T, A: Allocator> Box<T, A> {
453456 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
454457 // #[unstable(feature = "new_uninit", issue = "63291")]
455458 #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
459+ #[ cfg_attr( not( bootstrap) , allow( drop_bounds) ) ] // FIXME remove `~const Drop` and this attr when bumping
456460 pub const fn try_new_uninit_in ( alloc : A ) -> Result < Box < mem:: MaybeUninit < T > , A > , AllocError >
457461 where
458- A : ~const Allocator + ~const Drop ,
462+ A : ~const Allocator + ~const Drop + ~ const Destruct ,
459463 {
460464 let layout = Layout :: new :: < mem:: MaybeUninit < T > > ( ) ;
461465 let ptr = alloc. allocate ( layout) ?. cast ( ) ;
@@ -487,9 +491,10 @@ impl<T, A: Allocator> Box<T, A> {
487491 #[ cfg( not( no_global_oom_handling) ) ]
488492 // #[unstable(feature = "new_uninit", issue = "63291")]
489493 #[ must_use]
494+ #[ cfg_attr( not( bootstrap) , allow( drop_bounds) ) ] // FIXME remove `~const Drop` and this attr when bumping
490495 pub const fn new_zeroed_in ( alloc : A ) -> Box < mem:: MaybeUninit < T > , A >
491496 where
492- A : ~const Allocator + ~const Drop ,
497+ A : ~const Allocator + ~const Drop + ~ const Destruct ,
493498 {
494499 let layout = Layout :: new :: < mem:: MaybeUninit < T > > ( ) ;
495500 // NOTE: Prefer match over unwrap_or_else since closure sometimes not inlineable.
@@ -525,9 +530,10 @@ impl<T, A: Allocator> Box<T, A> {
525530 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
526531 // #[unstable(feature = "new_uninit", issue = "63291")]
527532 #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
533+ #[ cfg_attr( not( bootstrap) , allow( drop_bounds) ) ] // FIXME remove `~const Drop` and this attr when bumping
528534 pub const fn try_new_zeroed_in ( alloc : A ) -> Result < Box < mem:: MaybeUninit < T > , A > , AllocError >
529535 where
530- A : ~const Allocator + ~const Drop ,
536+ A : ~const Allocator + ~const Drop + ~ const Destruct ,
531537 {
532538 let layout = Layout :: new :: < mem:: MaybeUninit < T > > ( ) ;
533539 let ptr = alloc. allocate_zeroed ( layout) ?. cast ( ) ;
@@ -541,9 +547,10 @@ impl<T, A: Allocator> Box<T, A> {
541547 #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
542548 #[ must_use]
543549 #[ inline( always) ]
550+ #[ cfg_attr( not( bootstrap) , allow( drop_bounds) ) ] // FIXME remove `~const Drop` and this attr when bumping
544551 pub const fn pin_in ( x : T , alloc : A ) -> Pin < Self >
545552 where
546- A : ' static + ~const Allocator + ~const Drop ,
553+ A : ' static + ~const Allocator + ~const Drop + ~ const Destruct ,
547554 {
548555 Self :: into_pin ( Self :: new_in ( x, alloc) )
549556 }
@@ -572,9 +579,10 @@ impl<T, A: Allocator> Box<T, A> {
572579 #[ unstable( feature = "box_into_inner" , issue = "80437" ) ]
573580 #[ rustc_const_unstable( feature = "const_box" , issue = "92521" ) ]
574581 #[ inline]
582+ #[ cfg_attr( not( bootstrap) , allow( drop_bounds) ) ] // FIXME remove `~const Drop` and this attr when bumping
575583 pub const fn into_inner ( boxed : Self ) -> T
576584 where
577- Self : ~const Drop ,
585+ Self : ~const Drop + ~ const Destruct ,
578586 {
579587 * boxed
580588 }
0 commit comments