Stabilize ptr_addr_eq library feature
This commit is contained in:
parent
287ae4db75
commit
8d91d6662f
@ -140,7 +140,6 @@
|
|||||||
#![feature(maybe_uninit_uninit_array)]
|
#![feature(maybe_uninit_uninit_array)]
|
||||||
#![feature(maybe_uninit_uninit_array_transpose)]
|
#![feature(maybe_uninit_uninit_array_transpose)]
|
||||||
#![feature(pattern)]
|
#![feature(pattern)]
|
||||||
#![feature(ptr_addr_eq)]
|
|
||||||
#![feature(ptr_internals)]
|
#![feature(ptr_internals)]
|
||||||
#![feature(ptr_metadata)]
|
#![feature(ptr_metadata)]
|
||||||
#![feature(ptr_sub_ptr)]
|
#![feature(ptr_sub_ptr)]
|
||||||
|
@ -1898,14 +1898,15 @@ pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(ptr_addr_eq)]
|
/// use std::ptr;
|
||||||
///
|
///
|
||||||
/// let whole: &[i32; 3] = &[1, 2, 3];
|
/// let whole: &[i32; 3] = &[1, 2, 3];
|
||||||
/// let first: &i32 = &whole[0];
|
/// let first: &i32 = &whole[0];
|
||||||
/// assert!(std::ptr::addr_eq(whole, first));
|
///
|
||||||
/// assert!(!std::ptr::eq::<dyn std::fmt::Debug>(whole, first));
|
/// assert!(ptr::addr_eq(whole, first));
|
||||||
|
/// assert!(!ptr::eq::<dyn std::fmt::Debug>(whole, first));
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable(feature = "ptr_addr_eq", issue = "116324")]
|
#[stable(feature = "ptr_addr_eq", since = "CURRENT_RUSTC_VERSION")]
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
#[must_use = "pointer comparison produces a value"]
|
#[must_use = "pointer comparison produces a value"]
|
||||||
pub fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool {
|
pub fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user