@@ -216,7 +216,7 @@ impl Layout {
216216/// [trait object]: ../../book/ch17-02-trait-objects.html
217217/// [extern type]: ../../unstable-book/language-features/extern-types.html
218218#[ unstable( feature = "layout_for_ptr" , issue = "69835" ) ]
219- #[ rustc_const_unstable( feature = "const_alloc_layout " , issue = "67521 " ) ]
219+ #[ rustc_const_unstable( feature = "layout_for_ptr " , issue = "69835 " ) ]
220220#[ must_use]
221221pub const unsafe fn for_value_raw < T : ?Sized > ( t : * const T ) -> Self {
222222// SAFETY: we pass along the prerequisites of these functions to the caller
@@ -232,7 +232,6 @@ impl Layout {
232232/// sentinel value. Types that lazily allocate must track initialization by
233233/// some other means.
234234#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
235- #[ rustc_const_unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
236235#[ must_use]
237236#[ inline]
238237pub const fn dangling ( & self ) -> NonNull < u8 > {
@@ -256,6 +255,7 @@ impl Layout {
256255/// `align` violates the conditions listed in [`Layout::from_size_align`].
257256#[ stable( feature = "alloc_layout_manipulation" , since = "1.44.0" ) ]
258257#[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
258+ #[ cfg_attr( not( bootstrap) , rustc_const_stable_indirect) ]
259259#[ inline]
260260pub const fn align_to ( & self , align : usize ) -> Result < Self , LayoutError > {
261261if let Some ( align) = Alignment :: new ( align) {
@@ -282,7 +282,6 @@ impl Layout {
282282/// address for the whole allocated block of memory. One way to
283283/// satisfy this constraint is to ensure `align <= self.align()`.
284284#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
285- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
286285#[ must_use = "this returns the padding needed, \
287286 without modifying the `Layout`"]
288287#[ inline]
@@ -332,6 +331,7 @@ impl Layout {
332331/// to the layout's current size.
333332#[ stable( feature = "alloc_layout_manipulation" , since = "1.44.0" ) ]
334333#[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
334+ #[ cfg_attr( not( bootstrap) , rustc_const_stable_indirect) ]
335335#[ must_use = "this returns a new `Layout`, \
336336 without modifying the original"]
337337#[ inline]
@@ -374,7 +374,6 @@ impl Layout {
374374/// assert_eq!(repeated, (Layout::from_size_align(24, 4).unwrap(), 8));
375375/// ```
376376#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
377- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
378377#[ inline]
379378pub const fn repeat ( & self , n : usize ) -> Result < ( Self , usize ) , LayoutError > {
380379let padded = self . pad_to_align ( ) ;
@@ -432,6 +431,7 @@ impl Layout {
432431/// ```
433432#[ stable( feature = "alloc_layout_manipulation" , since = "1.44.0" ) ]
434433#[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
434+ #[ cfg_attr( not( bootstrap) , rustc_const_stable_indirect) ]
435435#[ inline]
436436pub const fn extend ( & self , next : Self ) -> Result < ( Self , usize ) , LayoutError > {
437437let new_align = Alignment :: max ( self . align , next. align ) ;
@@ -463,7 +463,6 @@ impl Layout {
463463///
464464/// On arithmetic overflow, returns `LayoutError`.
465465#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
466- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
467466#[ inline]
468467pub const fn repeat_packed ( & self , n : usize ) -> Result < Self , LayoutError > {
469468if let Some ( size) = self . size . checked_mul ( n) {
@@ -481,7 +480,6 @@ impl Layout {
481480///
482481/// On arithmetic overflow, returns `LayoutError`.
483482#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
484- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
485483#[ inline]
486484pub const fn extend_packed ( & self , next : Self ) -> Result < Self , LayoutError > {
487485// SAFETY: each `size` is at most `isize::MAX == usize::MAX/2`, so the
@@ -497,6 +495,7 @@ impl Layout {
497495/// `isize::MAX`, returns `LayoutError`.
498496#[ stable( feature = "alloc_layout_manipulation" , since = "1.44.0" ) ]
499497#[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
498+ #[ cfg_attr( not( bootstrap) , rustc_const_stable_indirect) ]
500499#[ inline]
501500pub const fn array < T > ( n : usize ) -> Result < Self , LayoutError > {
502501// Reduce the amount of code we need to monomorphize per `T`.
0 commit comments