Skip to content

Commit fcb9fcc

Browse files
Rollup merge of #117968 - Urgau:stabilize-ptr-addr-eq, r=dtolnay
Stabilize `ptr::addr_eq` This PR stabilize the `ptr_addr_eq` library feature, representing: ```rust // core::ptr pub fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool; ``` FCP has already started [on the tracking issue](#116324 (comment)) and is waiting on the final period comment. Note: stabilizing this feature is somewhat of requirement for a new T-lang lint, cf. #117758 (comment).
2 parents fd1a263 + 8d91d66 commit fcb9fcc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

library/alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@
140140
#![feature(maybe_uninit_uninit_array)]
141141
#![feature(maybe_uninit_uninit_array_transpose)]
142142
#![feature(pattern)]
143-
#![feature(ptr_addr_eq)]
144143
#![feature(ptr_internals)]
145144
#![feature(ptr_metadata)]
146145
#![feature(ptr_sub_ptr)]

library/core/src/ptr/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1898,14 +1898,15 @@ pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
18981898
/// # Examples
18991899
///
19001900
/// ```
1901-
/// #![feature(ptr_addr_eq)]
1901+
/// use std::ptr;
19021902
///
19031903
/// let whole: &[i32; 3] = &[1, 2, 3];
19041904
/// let first: &i32 = &whole[0];
1905-
/// assert!(std::ptr::addr_eq(whole, first));
1906-
/// assert!(!std::ptr::eq::<dyn std::fmt::Debug>(whole, first));
1905+
///
1906+
/// assert!(ptr::addr_eq(whole, first));
1907+
/// assert!(!ptr::eq::<dyn std::fmt::Debug>(whole, first));
19071908
/// ```
1908-
#[unstable(feature = "ptr_addr_eq", issue = "116324")]
1909+
#[stable(feature = "ptr_addr_eq", since = "CURRENT_RUSTC_VERSION")]
19091910
#[inline(always)]
19101911
#[must_use = "pointer comparison produces a value"]
19111912
pub fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool {

0 commit comments

Comments
 (0)