Skip to content

Commit

Permalink
Fill-in tracking issues for features pointer_byte_offsets, const_poin…
Browse files Browse the repository at this point in the history
…ter_byte_offsets and pointer_is_aligned
  • Loading branch information
WaffleLapkin committed May 12, 2022
1 parent 5a5d62a commit 03d4569
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
32 changes: 16 additions & 16 deletions library/core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,8 @@ impl<T: ?Sized> *const T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const unsafe fn byte_offset(self, count: isize) -> Self {
// SAFETY: the caller must uphold the safety contract for `offset`.
let this = unsafe { self.cast::<u8>().offset(count).cast::<()>() };
Expand Down Expand Up @@ -549,8 +549,8 @@ impl<T: ?Sized> *const T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const fn wrapping_byte_offset(self, count: isize) -> Self {
from_raw_parts::<T>(self.cast::<u8>().wrapping_offset(count).cast::<()>(), metadata(self))
}
Expand Down Expand Up @@ -659,8 +659,8 @@ impl<T: ?Sized> *const T {
/// For non-`Sized` pointees this operation considers only the data pointers,
/// ignoring the metadata.
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const unsafe fn byte_offset_from(self, origin: *const T) -> isize {
// SAFETY: the caller must uphold the safety contract for `offset_from`.
unsafe { self.cast::<u8>().offset_from(origin.cast::<u8>()) }
Expand Down Expand Up @@ -880,8 +880,8 @@ impl<T: ?Sized> *const T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const unsafe fn byte_add(self, count: usize) -> Self {
// SAFETY: the caller must uphold the safety contract for `add`.
let this = unsafe { self.cast::<u8>().add(count).cast::<()>() };
Expand Down Expand Up @@ -965,8 +965,8 @@ impl<T: ?Sized> *const T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const unsafe fn byte_sub(self, count: usize) -> Self {
// SAFETY: the caller must uphold the safety contract for `sub`.
let this = unsafe { self.cast::<u8>().sub(count).cast::<()>() };
Expand Down Expand Up @@ -1047,8 +1047,8 @@ impl<T: ?Sized> *const T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const fn wrapping_byte_add(self, count: usize) -> Self {
from_raw_parts::<T>(self.cast::<u8>().wrapping_add(count).cast::<()>(), metadata(self))
}
Expand Down Expand Up @@ -1127,8 +1127,8 @@ impl<T: ?Sized> *const T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const fn wrapping_byte_sub(self, count: usize) -> Self {
from_raw_parts::<T>(self.cast::<u8>().wrapping_sub(count).cast::<()>(), metadata(self))
}
Expand Down Expand Up @@ -1296,7 +1296,7 @@ impl<T: ?Sized> *const T {
/// Returns whether the pointer is properly aligned for `T`.
#[must_use]
#[inline]
#[unstable(feature = "pointer_is_aligned", issue = "none")]
#[unstable(feature = "pointer_is_aligned", issue = "96284")]
pub fn is_aligned(self) -> bool
where
T: Sized,
Expand All @@ -1314,7 +1314,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 = "none")]
#[unstable(feature = "pointer_is_aligned", issue = "96284")]
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
32 changes: 16 additions & 16 deletions library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,8 @@ impl<T: ?Sized> *mut T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const unsafe fn byte_offset(self, count: isize) -> Self {
// SAFETY: the caller must uphold the safety contract for `offset`.
let this = unsafe { self.cast::<u8>().offset(count).cast::<()>() };
Expand Down Expand Up @@ -560,8 +560,8 @@ impl<T: ?Sized> *mut T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const fn wrapping_byte_offset(self, count: isize) -> Self {
from_raw_parts_mut::<T>(
self.cast::<u8>().wrapping_offset(count).cast::<()>(),
Expand Down Expand Up @@ -838,8 +838,8 @@ impl<T: ?Sized> *mut T {
/// For non-`Sized` pointees this operation considers only the data pointers,
/// ignoring the metadata.
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const unsafe fn byte_offset_from(self, origin: *const T) -> isize {
// SAFETY: the caller must uphold the safety contract for `offset_from`.
unsafe { self.cast::<u8>().offset_from(origin.cast::<u8>()) }
Expand Down Expand Up @@ -992,8 +992,8 @@ impl<T: ?Sized> *mut T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const unsafe fn byte_add(self, count: usize) -> Self {
// SAFETY: the caller must uphold the safety contract for `add`.
let this = unsafe { self.cast::<u8>().add(count).cast::<()>() };
Expand Down Expand Up @@ -1077,8 +1077,8 @@ impl<T: ?Sized> *mut T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const unsafe fn byte_sub(self, count: usize) -> Self {
// SAFETY: the caller must uphold the safety contract for `sub`.
let this = unsafe { self.cast::<u8>().sub(count).cast::<()>() };
Expand Down Expand Up @@ -1159,8 +1159,8 @@ impl<T: ?Sized> *mut T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const fn wrapping_byte_add(self, count: usize) -> Self {
from_raw_parts_mut::<T>(self.cast::<u8>().wrapping_add(count).cast::<()>(), metadata(self))
}
Expand Down Expand Up @@ -1239,8 +1239,8 @@ impl<T: ?Sized> *mut T {
/// leaving the metadata untouched.
#[must_use]
#[inline(always)]
#[unstable(feature = "pointer_byte_offsets", issue = "none")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "none")]
#[unstable(feature = "pointer_byte_offsets", issue = "96283")]
#[rustc_const_unstable(feature = "const_pointer_byte_offsets", issue = "96283")]
pub const fn wrapping_byte_sub(self, count: usize) -> Self {
from_raw_parts_mut::<T>(self.cast::<u8>().wrapping_sub(count).cast::<()>(), metadata(self))
}
Expand Down Expand Up @@ -1565,7 +1565,7 @@ impl<T: ?Sized> *mut T {
/// Returns whether the pointer is properly aligned for `T`.
#[must_use]
#[inline]
#[unstable(feature = "pointer_is_aligned", issue = "none")]
#[unstable(feature = "pointer_is_aligned", issue = "96284")]
pub fn is_aligned(self) -> bool
where
T: Sized,
Expand All @@ -1583,7 +1583,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 = "none")]
#[unstable(feature = "pointer_is_aligned", issue = "96284")]
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

0 comments on commit 03d4569

Please sign in to comment.