Skip to content

Commit 37fe087

Browse files
committed
Revert Layout::padding_needed_for stabilization
1 parent a342c0f commit 37fe087

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

library/alloc/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
#![feature(inplace_iteration)]
121121
#![feature(iter_advance_by)]
122122
#![feature(layout_for_ptr)]
123+
#![feature(layout_padding_needed_for)]
123124
#![feature(maybe_uninit_slice)]
124125
#![cfg_attr(test, feature(new_uninit))]
125126
#![feature(nonnull_slice_from_raw_parts)]

library/core/src/alloc/layout.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,14 @@ impl Layout {
225225
/// padding required to get a 4-aligned address (assuming that the
226226
/// corresponding memory block starts at a 4-aligned address).
227227
///
228+
/// The return value of this function has no meaning if `align` is
229+
/// not a power-of-two.
230+
///
228231
/// Note that the utility of the returned value requires `align`
229232
/// to be less than or equal to the alignment of the starting
230233
/// address for the whole allocated block of memory. One way to
231234
/// satisfy this constraint is to ensure `align <= self.align()`.
232-
#[stable(feature = "alloc_layout_extra", since = "1.63.0")]
235+
#[unstable(feature = "layout_padding_needed_for", issue = "55724")]
233236
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
234237
#[must_use = "this returns the padding needed, \
235238
without modifying the `Layout`"]

0 commit comments

Comments
 (0)