Add diagnostic items for <*const _>::cast
and ptr::from_mut
This commit is contained in:
parent
ef3413d423
commit
0b9529cca3
3 changed files with 4 additions and 0 deletions
|
@ -1155,8 +1155,10 @@ symbols! {
|
||||||
profiler_builtins,
|
profiler_builtins,
|
||||||
profiler_runtime,
|
profiler_runtime,
|
||||||
ptr,
|
ptr,
|
||||||
|
ptr_cast,
|
||||||
ptr_cast_mut,
|
ptr_cast_mut,
|
||||||
ptr_const_is_null,
|
ptr_const_is_null,
|
||||||
|
ptr_from_mut,
|
||||||
ptr_from_ref,
|
ptr_from_ref,
|
||||||
ptr_guaranteed_cmp,
|
ptr_guaranteed_cmp,
|
||||||
ptr_is_null,
|
ptr_is_null,
|
||||||
|
|
|
@ -710,6 +710,7 @@ pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[unstable(feature = "ptr_from_ref", issue = "106116")]
|
#[unstable(feature = "ptr_from_ref", issue = "106116")]
|
||||||
|
#[rustc_diagnostic_item = "ptr_from_mut"]
|
||||||
pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
|
pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
|
||||||
r
|
r
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@ impl<T: ?Sized> *mut T {
|
||||||
/// Casts to a pointer of another type.
|
/// Casts to a pointer of another type.
|
||||||
#[stable(feature = "ptr_cast", since = "1.38.0")]
|
#[stable(feature = "ptr_cast", since = "1.38.0")]
|
||||||
#[rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0")]
|
#[rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0")]
|
||||||
|
#[rustc_diagnostic_item = "ptr_cast"]
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub const fn cast<U>(self) -> *mut U {
|
pub const fn cast<U>(self) -> *mut U {
|
||||||
self as _
|
self as _
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue