@@ -231,9 +231,8 @@ impl Layout {
231
231
/// Returns an error if the combination of `self.size()` and the given
232
232
/// `align` violates the conditions listed in [`Layout::from_size_align`].
233
233
#[ stable( feature = "alloc_layout_manipulation" , since = "1.44.0" ) ]
234
- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
235
234
#[ inline]
236
- pub const fn align_to ( & self , align : usize ) -> Result < Self , LayoutError > {
235
+ pub fn align_to ( & self , align : usize ) -> Result < Self , LayoutError > {
237
236
Layout :: from_size_align ( self . size ( ) , cmp:: max ( self . align ( ) , align) )
238
237
}
239
238
@@ -315,9 +314,8 @@ impl Layout {
315
314
///
316
315
/// On arithmetic overflow, returns `LayoutError`.
317
316
#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
318
- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
319
317
#[ inline]
320
- pub const fn repeat ( & self , n : usize ) -> Result < ( Self , usize ) , LayoutError > {
318
+ pub fn repeat ( & self , n : usize ) -> Result < ( Self , usize ) , LayoutError > {
321
319
// This cannot overflow. Quoting from the invariant of Layout:
322
320
// > `size`, when rounded up to the nearest multiple of `align`,
323
321
// > must not overflow isize (i.e., the rounded value must be
@@ -376,9 +374,8 @@ impl Layout {
376
374
/// # assert_eq!(repr_c(&[u64, u32, u16, u32]), Ok((s, vec![0, 8, 12, 16])));
377
375
/// ```
378
376
#[ stable( feature = "alloc_layout_manipulation" , since = "1.44.0" ) ]
379
- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
380
377
#[ inline]
381
- pub const fn extend ( & self , next : Self ) -> Result < ( Self , usize ) , LayoutError > {
378
+ pub fn extend ( & self , next : Self ) -> Result < ( Self , usize ) , LayoutError > {
382
379
let new_align = cmp:: max ( self . align , next. align ) ;
383
380
let pad = self . padding_needed_for ( next. align ( ) ) ;
384
381
@@ -403,9 +400,8 @@ impl Layout {
403
400
///
404
401
/// On arithmetic overflow, returns `LayoutError`.
405
402
#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
406
- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
407
403
#[ inline]
408
- pub const fn repeat_packed ( & self , n : usize ) -> Result < Self , LayoutError > {
404
+ pub fn repeat_packed ( & self , n : usize ) -> Result < Self , LayoutError > {
409
405
let size = self . size ( ) . checked_mul ( n) . ok_or ( LayoutError ) ?;
410
406
// The safe constructor is called here to enforce the isize size limit.
411
407
Layout :: from_size_alignment ( size, self . align )
@@ -418,9 +414,8 @@ impl Layout {
418
414
///
419
415
/// On arithmetic overflow, returns `LayoutError`.
420
416
#[ unstable( feature = "alloc_layout_extra" , issue = "55724" ) ]
421
- #[ rustc_const_unstable( feature = "const_alloc_layout" , issue = "67521" ) ]
422
417
#[ inline]
423
- pub const fn extend_packed ( & self , next : Self ) -> Result < Self , LayoutError > {
418
+ pub fn extend_packed ( & self , next : Self ) -> Result < Self , LayoutError > {
424
419
let new_size = self . size ( ) . checked_add ( next. size ( ) ) . ok_or ( LayoutError ) ?;
425
420
// The safe constructor is called here to enforce the isize size limit.
426
421
Layout :: from_size_alignment ( new_size, self . align )
0 commit comments