Skip to content

Commit 9050d12

Browse files
committed
Stabilize alloc::Layout const functions
Stabilizes #67521. In particular the following stable methods are stabilized as const fn: * size * align * from_size_align
1 parent c643dd2 commit 9050d12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/core/src/alloc/layout.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl Layout {
5050
/// must not overflow (i.e., the rounded value must be less than
5151
/// or equal to `usize::MAX`).
5252
#[stable(feature = "alloc_layout", since = "1.28.0")]
53-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
53+
#[rustc_const_stable(feature = "const_alloc_layout", since = "1.50.0")]
5454
#[inline]
5555
pub const fn from_size_align(size: usize, align: usize) -> Result<Self, LayoutError> {
5656
if !align.is_power_of_two() {
@@ -96,15 +96,15 @@ impl Layout {
9696

9797
/// The minimum size in bytes for a memory block of this layout.
9898
#[stable(feature = "alloc_layout", since = "1.28.0")]
99-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
99+
#[rustc_const_stable(feature = "const_alloc_layout", since = "1.50.0")]
100100
#[inline]
101101
pub const fn size(&self) -> usize {
102102
self.size_
103103
}
104104

105105
/// The minimum byte alignment for a memory block of this layout.
106106
#[stable(feature = "alloc_layout", since = "1.28.0")]
107-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
107+
#[rustc_const_stable(feature = "const_alloc_layout", since = "1.50.0")]
108108
#[inline]
109109
pub const fn align(&self) -> usize {
110110
self.align_.get()

0 commit comments

Comments
 (0)