Auto merge of #121948 - Gankra:stab-align, r=dtolnay · rust-lang/rust@174d07b (original) (raw)

`@@ -1401,8 +1401,6 @@ impl<T: ?Sized> *const T {

`

1401

1401

`/// # Examples

`

1402

1402

`///

`

1403

1403

```` /// ```


`1404`

``

`-

/// #![feature(pointer_is_aligned)]

`

`1405`

``

`-

///

`

`1406`

`1404`

`/// // On some platforms, the alignment of i32 is less than 4.

`

`1407`

`1405`

`/// #[repr(align(4))]

`

`1408`

`1406`

`/// struct AlignedI32(i32);

`

`@@ -1425,7 +1423,6 @@ impl<T: ?Sized> *const T {

`

`1425`

`1423`

`/// underlying allocation.

`

`1426`

`1424`

`///

`

`1427`

`1425`

```` /// ```

1428

``

`-

/// #![feature(pointer_is_aligned)]

`

1429

1426

`/// #![feature(const_pointer_is_aligned)]

`

1430

1427

`///

`

1431

1428

`/// // On some platforms, the alignment of primitives is less than their size.

`

`@@ -1451,7 +1448,6 @@ impl<T: ?Sized> *const T {

`

1451

1448

`/// pointer is aligned, even if the compiletime pointer wasn't aligned.

`

1452

1449

`///

`

1453

1450

```` /// ```


`1454`

``

`-

/// #![feature(pointer_is_aligned)]

`

`1455`

`1451`

`/// #![feature(const_pointer_is_aligned)]

`

`1456`

`1452`

`///

`

`1457`

`1453`

`/// // On some platforms, the alignment of primitives is less than their size.

`

`@@ -1477,7 +1473,6 @@ impl<T: ?Sized> *const T {

`

`1477`

`1473`

`/// runtime and compiletime.

`

`1478`

`1474`

`///

`

`1479`

`1475`

```` /// ```

1480

``

`-

/// #![feature(pointer_is_aligned)]

`

1481

1476

`/// #![feature(const_pointer_is_aligned)]

`

1482

1477

`///

`

1483

1478

`/// // On some platforms, the alignment of primitives is less than their size.

`

`@@ -1501,7 +1496,7 @@ impl<T: ?Sized> *const T {

`

1501

1496

`/// [tracking issue]: https://github.com/rust-lang/rust/issues/104203

`

1502

1497

`#[must_use]

`

1503

1498

`#[inline]

`

1504

``

`-

#[unstable(feature = "pointer_is_aligned", issue = "96284")]

`

``

1499

`+

#[stable(feature = "pointer_is_aligned", since = "CURRENT_RUSTC_VERSION")]

`

1505

1500

`#[rustc_const_unstable(feature = "const_pointer_is_aligned", issue = "104203")]

`

1506

1501

`pub const fn is_aligned(self) -> bool

`

1507

1502

`where

`

`@@ -1522,7 +1517,7 @@ impl<T: ?Sized> *const T {

`

1522

1517

`/// # Examples

`

1523

1518

`///

`

1524

1519

```` /// ```


`1525`

``

`-

/// #![feature(pointer_is_aligned)]

`

``

`1520`

`+

/// #![feature(pointer_is_aligned_to)]

`

`1526`

`1521`

`///

`

`1527`

`1522`

`/// // On some platforms, the alignment of i32 is less than 4.

`

`1528`

`1523`

`/// #[repr(align(4))]

`

`@@ -1551,7 +1546,7 @@ impl<T: ?Sized> *const T {

`

`1551`

`1546`

`/// cannot be stricter aligned than the reference's underlying allocation.

`

`1552`

`1547`

`///

`

`1553`

`1548`

```` /// ```

1554

``

`-

/// #![feature(pointer_is_aligned)]

`

``

1549

`+

/// #![feature(pointer_is_aligned_to)]

`

1555

1550

`/// #![feature(const_pointer_is_aligned)]

`

1556

1551

`///

`

1557

1552

`/// // On some platforms, the alignment of i32 is less than 4.

`

`@@ -1576,7 +1571,7 @@ impl<T: ?Sized> *const T {

`

1576

1571

`/// pointer is aligned, even if the compiletime pointer wasn't aligned.

`

1577

1572

`///

`

1578

1573

```` /// ```


`1579`

``

`-

/// #![feature(pointer_is_aligned)]

`

``

`1574`

`+

/// #![feature(pointer_is_aligned_to)]

`

`1580`

`1575`

`/// #![feature(const_pointer_is_aligned)]

`

`1581`

`1576`

`///

`

`1582`

`1577`

`/// // On some platforms, the alignment of i32 is less than 4.

`

`@@ -1600,7 +1595,7 @@ impl<T: ?Sized> *const T {

`

`1600`

`1595`

`/// runtime and compiletime.

`

`1601`

`1596`

`///

`

`1602`

`1597`

```` /// ```

1603

``

`-

/// #![feature(pointer_is_aligned)]

`

``

1598

`+

/// #![feature(pointer_is_aligned_to)]

`

1604

1599

`/// #![feature(const_pointer_is_aligned)]

`

1605

1600

`///

`

1606

1601

`/// const _: () = {

`

`@@ -1616,7 +1611,7 @@ impl<T: ?Sized> *const T {

`

1616

1611

`/// [tracking issue]: https://github.com/rust-lang/rust/issues/104203

`

1617

1612

`#[must_use]

`

1618

1613

`#[inline]

`

1619

``

`-

#[unstable(feature = "pointer_is_aligned", issue = "96284")]

`

``

1614

`+

#[unstable(feature = "pointer_is_aligned_to", issue = "96284")]

`

1620

1615

`#[rustc_const_unstable(feature = "const_pointer_is_aligned", issue = "104203")]

`

1621

1616

`pub const fn is_aligned_to(self, align: usize) -> bool {

`

1622

1617

`if !align.is_power_of_two() {

`