@@ -216,7 +216,7 @@ impl Layout {
216
216
/// [trait object]: ../../book/ch17-02-trait-objects.html
217
217
/// [extern type]: ../../unstable-book/language-features/extern-types.html
218
218
#[ 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 " ) ]
220
220
#[ must_use]
221
221
pub const unsafe fn for_value_raw < T : ?Sized > ( t : * const T ) -> Self {
222
222
// SAFETY: we pass along the prerequisites of these functions to the caller
@@ -232,7 +232,6 @@ impl Layout {
232
232
/// sentinel value. Types that lazily allocate must track initialization by
233
233
/// some other means.
234
234
#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
235
- #[ rustc_const_unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
236
235
#[ must_use]
237
236
#[ inline]
238
237
pub const fn dangling ( & self ) -> NonNull < u8 > {
@@ -282,7 +281,6 @@ impl Layout {
282
281
/// address for the whole allocated block of memory. One way to
283
282
/// satisfy this constraint is to ensure `align <= self.align()`.
284
283
#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
285
- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
286
284
#[ must_use = "this returns the padding needed, \
287
285
without modifying the `Layout`"]
288
286
#[ inline]
@@ -332,6 +330,7 @@ impl Layout {
332
330
/// to the layout's current size.
333
331
#[ stable( feature = "alloc_layout_manipulation" , since = "1.44.0" ) ]
334
332
#[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
333
+ #[ cfg_attr( not( bootstrap) , rustc_const_stable_indirect) ]
335
334
#[ must_use = "this returns a new `Layout`, \
336
335
without modifying the original"]
337
336
#[ inline]
@@ -374,7 +373,6 @@ impl Layout {
374
373
/// assert_eq!(repeated, (Layout::from_size_align(24, 4).unwrap(), 8));
375
374
/// ```
376
375
#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
377
- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
378
376
#[ inline]
379
377
pub const fn repeat ( & self , n : usize ) -> Result < ( Self , usize ) , LayoutError > {
380
378
let padded = self . pad_to_align ( ) ;
@@ -432,6 +430,7 @@ impl Layout {
432
430
/// ```
433
431
#[ stable( feature = "alloc_layout_manipulation" , since = "1.44.0" ) ]
434
432
#[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
433
+ #[ cfg_attr( not( bootstrap) , rustc_const_stable_indirect) ]
435
434
#[ inline]
436
435
pub const fn extend ( & self , next : Self ) -> Result < ( Self , usize ) , LayoutError > {
437
436
let new_align = Alignment :: max ( self . align , next. align ) ;
@@ -463,7 +462,6 @@ impl Layout {
463
462
///
464
463
/// On arithmetic overflow, returns `LayoutError`.
465
464
#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
466
- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
467
465
#[ inline]
468
466
pub const fn repeat_packed ( & self , n : usize ) -> Result < Self , LayoutError > {
469
467
if let Some ( size) = self . size . checked_mul ( n) {
@@ -481,7 +479,6 @@ impl Layout {
481
479
///
482
480
/// On arithmetic overflow, returns `LayoutError`.
483
481
#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
484
- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
485
482
#[ inline]
486
483
pub const fn extend_packed ( & self , next : Self ) -> Result < Self , LayoutError > {
487
484
// SAFETY: each `size` is at most `isize::MAX == usize::MAX/2`, so the
@@ -497,6 +494,7 @@ impl Layout {
497
494
/// `isize::MAX`, returns `LayoutError`.
498
495
#[ stable( feature = "alloc_layout_manipulation" , since = "1.44.0" ) ]
499
496
#[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
497
+ #[ cfg_attr( not( bootstrap) , rustc_const_stable_indirect) ]
500
498
#[ inline]
501
499
pub const fn array < T > ( n : usize ) -> Result < Self , LayoutError > {
502
500
// Reduce the amount of code we need to monomorphize per `T`.
0 commit comments