Add diagnostic items for ptr::cast_mut and ptr::from_ref
This commit is contained in:
@@ -1146,6 +1146,8 @@ symbols! {
|
||||
profiler_builtins,
|
||||
profiler_runtime,
|
||||
ptr,
|
||||
ptr_cast_mut,
|
||||
ptr_from_ref,
|
||||
ptr_guaranteed_cmp,
|
||||
ptr_mask,
|
||||
ptr_null,
|
||||
|
||||
@@ -104,6 +104,7 @@ impl<T: ?Sized> *const T {
|
||||
/// refactored.
|
||||
#[stable(feature = "ptr_const_cast", since = "1.65.0")]
|
||||
#[rustc_const_stable(feature = "ptr_const_cast", since = "1.65.0")]
|
||||
#[rustc_diagnostic_item = "ptr_cast_mut"]
|
||||
#[inline(always)]
|
||||
pub const fn cast_mut(self) -> *mut T {
|
||||
self as _
|
||||
|
||||
@@ -698,6 +698,7 @@ where
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
#[unstable(feature = "ptr_from_ref", issue = "106116")]
|
||||
#[rustc_diagnostic_item = "ptr_from_ref"]
|
||||
pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {
|
||||
r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user