Skip to content

Commit a25032c

Browse files
committed
Auto merge of rust-lang#134768 - RalfJung:const_alloc_layout, r=jhpratt
stabilize const_alloc_layout libs-api FCP passed in rust-lang#67521 Fixes rust-lang#67521
2 parents 7c002ff + 88b88f3 commit a25032c

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

library/core/src/alloc/layout.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ impl Layout {
178178
/// allocate backing structure for `T` (which could be a trait
179179
/// or other unsized type like a slice).
180180
#[stable(feature = "alloc_layout", since = "1.28.0")]
181-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
182-
#[rustc_const_stable_indirect]
181+
#[rustc_const_stable(feature = "const_alloc_layout", since = "CURRENT_RUSTC_VERSION")]
183182
#[must_use]
184183
#[inline]
185184
pub const fn for_value<T: ?Sized>(t: &T) -> Self {
@@ -253,8 +252,7 @@ impl Layout {
253252
/// Returns an error if the combination of `self.size()` and the given
254253
/// `align` violates the conditions listed in [`Layout::from_size_align`].
255254
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
256-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
257-
#[rustc_const_stable_indirect]
255+
#[rustc_const_stable(feature = "const_alloc_layout", since = "CURRENT_RUSTC_VERSION")]
258256
#[inline]
259257
pub const fn align_to(&self, align: usize) -> Result<Self, LayoutError> {
260258
if let Some(align) = Alignment::new(align) {
@@ -329,8 +327,7 @@ impl Layout {
329327
/// This is equivalent to adding the result of `padding_needed_for`
330328
/// to the layout's current size.
331329
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
332-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
333-
#[rustc_const_stable_indirect]
330+
#[rustc_const_stable(feature = "const_alloc_layout", since = "CURRENT_RUSTC_VERSION")]
334331
#[must_use = "this returns a new `Layout`, \
335332
without modifying the original"]
336333
#[inline]
@@ -429,8 +426,7 @@ impl Layout {
429426
/// # assert_eq!(repr_c(&[u64, u32, u16, u32]), Ok((s, vec![0, 8, 12, 16])));
430427
/// ```
431428
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
432-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
433-
#[rustc_const_stable_indirect]
429+
#[rustc_const_stable(feature = "const_alloc_layout", since = "CURRENT_RUSTC_VERSION")]
434430
#[inline]
435431
pub const fn extend(&self, next: Self) -> Result<(Self, usize), LayoutError> {
436432
let new_align = Alignment::max(self.align, next.align);
@@ -493,8 +489,7 @@ impl Layout {
493489
/// On arithmetic overflow or when the total size would exceed
494490
/// `isize::MAX`, returns `LayoutError`.
495491
#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
496-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
497-
#[rustc_const_stable_indirect]
492+
#[rustc_const_stable(feature = "const_alloc_layout", since = "CURRENT_RUSTC_VERSION")]
498493
#[inline]
499494
pub const fn array<T>(n: usize) -> Result<Self, LayoutError> {
500495
// Reduce the amount of code we need to monomorphize per `T`.

0 commit comments

Comments
 (0)