Skip to content

Commit

Permalink
Stabilize pointer_is_aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Sep 4, 2022
1 parent 001ea32 commit 8d7c414
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@
#![feature(never_type)]
#![feature(rustc_allow_const_fn_unstable)]
#![feature(rustc_attrs)]
#![feature(pointer_is_aligned)]
#![feature(slice_internals)]
#![feature(staged_api)]
#![feature(stmt_expr_attributes)]
Expand Down
1 change: 0 additions & 1 deletion library/alloc/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#![feature(const_str_from_utf8)]
#![feature(nonnull_slice_from_raw_parts)]
#![feature(panic_update_hook)]
#![feature(pointer_is_aligned)]
#![feature(slice_flatten)]
#![feature(thin_box)]
#![feature(bench_black_box)]
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ impl<T: ?Sized> *const T {
/// Returns whether the pointer is properly aligned for `T`.
#[must_use]
#[inline]
#[unstable(feature = "pointer_is_aligned", issue = "96284")]
#[stable(feature = "pointer_is_aligned", since = "CURRENT_RUSTC_VERSION")]
pub fn is_aligned(self) -> bool
where
T: Sized,
Expand All @@ -1353,7 +1353,7 @@ impl<T: ?Sized> *const T {
/// The function panics if `align` is not a power-of-two (this includes 0).
#[must_use]
#[inline]
#[unstable(feature = "pointer_is_aligned", issue = "96284")]
#[stable(feature = "pointer_is_aligned", since = "CURRENT_RUSTC_VERSION")]
pub fn is_aligned_to(self, align: usize) -> bool {
if !align.is_power_of_two() {
panic!("is_aligned_to: align is not a power-of-two");
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ impl<T: ?Sized> *mut T {
/// Returns whether the pointer is properly aligned for `T`.
#[must_use]
#[inline]
#[unstable(feature = "pointer_is_aligned", issue = "96284")]
#[stable(feature = "pointer_is_aligned", since = "CURRENT_RUSTC_VERSION")]
pub fn is_aligned(self) -> bool
where
T: Sized,
Expand All @@ -1633,7 +1633,7 @@ impl<T: ?Sized> *mut T {
/// The function panics if `align` is not a power-of-two (this includes 0).
#[must_use]
#[inline]
#[unstable(feature = "pointer_is_aligned", issue = "96284")]
#[stable(feature = "pointer_is_aligned", since = "CURRENT_RUSTC_VERSION")]
pub fn is_aligned_to(self, align: usize) -> bool {
if !align.is_power_of_two() {
panic!("is_aligned_to: align is not a power-of-two");
Expand Down
1 change: 0 additions & 1 deletion library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@
#![feature(panic_can_unwind)]
#![feature(panic_info_message)]
#![feature(panic_internals)]
#![feature(pointer_is_aligned)]
#![feature(portable_simd)]
#![feature(prelude_2024)]
#![feature(provide_any)]
Expand Down

0 comments on commit 8d7c414

Please sign in to comment.