make const_alloc_layout feature gate only about functions that are al… · qinheping/verify-rust-std@f4e1fa3 (original) (raw)
`@@ -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 {
`
`@@ -256,6 +255,7 @@ impl Layout {
`
256
255
`` /// align
violates the conditions listed in [Layout::from_size_align
].
``
257
256
`#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
`
258
257
`#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
`
``
258
`+
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
`
259
259
`#[inline]
`
260
260
`pub const fn align_to(&self, align: usize) -> Result<Self, LayoutError> {
`
261
261
`if let Some(align) = Alignment::new(align) {
`
`@@ -282,7 +282,6 @@ impl Layout {
`
282
282
`/// address for the whole allocated block of memory. One way to
`
283
283
`` /// satisfy this constraint is to ensure align <= self.align()
.
``
284
284
`#[unstable(feature = "alloc_layout_extra", issue = "55724")]
`
285
``
`-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
`
286
285
`#[must_use = "this returns the padding needed, \
`
287
286
`` without modifying the Layout
"]
``
288
287
`#[inline]
`
`@@ -332,6 +331,7 @@ impl Layout {
`
332
331
`/// to the layout's current size.
`
333
332
`#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
`
334
333
`#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
`
``
334
`+
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
`
335
335
`` #[must_use = "this returns a new Layout
, \
``
336
336
` without modifying the original"]
`
337
337
`#[inline]
`
`@@ -374,7 +374,6 @@ impl Layout {
`
374
374
`/// assert_eq!(repeated, (Layout::from_size_align(24, 4).unwrap(), 8));
`
375
375
```` /// ```
`376`
`376`
`#[unstable(feature = "alloc_layout_extra", issue = "55724")]
`
`377`
``
`-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
`
`378`
`377`
`#[inline]
`
`379`
`378`
`pub const fn repeat(&self, n: usize) -> Result<(Self, usize), LayoutError> {
`
`380`
`379`
`let padded = self.pad_to_align();
`
`@@ -432,6 +431,7 @@ impl Layout {
`
`432`
`431`
```` /// ```
433
432
`#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
`
434
433
`#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
`
``
434
`+
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
`
435
435
`#[inline]
`
436
436
`pub const fn extend(&self, next: Self) -> Result<(Self, usize), LayoutError> {
`
437
437
`let new_align = Alignment::max(self.align, next.align);
`
`@@ -463,7 +463,6 @@ impl Layout {
`
463
463
`///
`
464
464
`` /// On arithmetic overflow, returns LayoutError
.
``
465
465
`#[unstable(feature = "alloc_layout_extra", issue = "55724")]
`
466
``
`-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
`
467
466
`#[inline]
`
468
467
`pub const fn repeat_packed(&self, n: usize) -> Result<Self, LayoutError> {
`
469
468
`if let Some(size) = self.size.checked_mul(n) {
`
`@@ -481,7 +480,6 @@ impl Layout {
`
481
480
`///
`
482
481
`` /// On arithmetic overflow, returns LayoutError
.
``
483
482
`#[unstable(feature = "alloc_layout_extra", issue = "55724")]
`
484
``
`-
#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
`
485
483
`#[inline]
`
486
484
`pub const fn extend_packed(&self, next: Self) -> Result<Self, LayoutError> {
`
487
485
`` // SAFETY: each size
is at most isize::MAX == usize::MAX/2
, so the
``
`@@ -497,6 +495,7 @@ impl Layout {
`
497
495
`` /// isize::MAX
, returns LayoutError
.
``
498
496
`#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]
`
499
497
`#[rustc_const_unstable(feature = "const_alloc_layout", issue = "67521")]
`
``
498
`+
#[cfg_attr(not(bootstrap), rustc_const_stable_indirect)]
`
500
499
`#[inline]
`
501
500
`pub const fn array(n: usize) -> Result<Self, LayoutError> {
`
502
501
`` // Reduce the amount of code we need to monomorphize per T
.
``