Skip to content

Commit

Permalink
Rollup merge of rust-lang#92981 - RalfJung:const_ptr_offset_from, r=d…
Browse files Browse the repository at this point in the history
…tolnay

fix const_ptr_offset_from tracking issue

The old tracking issue rust-lang#41079 was for exposing those functions at all, and got closed when they were stabilized. We had nothing tracking their `const`ness so I opened a new tracking issue: rust-lang#92980.
  • Loading branch information
matthiaskrgr authored Jan 17, 2022
2 parents 7bdd978 + bb1423e commit 9612038
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,7 @@ extern "rust-intrinsic" {
pub fn nontemporal_store<T>(ptr: *mut T, val: T);

/// See documentation of `<*const T>::offset_from` for details.
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079")]
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")]
pub fn ptr_offset_from<T>(ptr: *const T, base: *const T) -> isize;

/// See documentation of `<*const T>::guaranteed_eq` for details.
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl<T: ?Sized> *const T {
/// }
/// ```
#[stable(feature = "ptr_offset_from", since = "1.47.0")]
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079")]
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")]
#[inline]
pub const unsafe fn offset_from(self, origin: *const T) -> isize
where
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ impl<T: ?Sized> *mut T {
/// }
/// ```
#[stable(feature = "ptr_offset_from", since = "1.47.0")]
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079")]
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")]
#[inline(always)]
pub const unsafe fn offset_from(self, origin: *const T) -> isize
where
Expand Down

0 comments on commit 9612038

Please sign in to comment.