Add diagnostic items for <*const _>::cast and <*mut _>::cast_const
This commit is contained in:
@@ -543,6 +543,7 @@ symbols! {
|
|||||||
const_panic_fmt,
|
const_panic_fmt,
|
||||||
const_param_ty,
|
const_param_ty,
|
||||||
const_precise_live_drops,
|
const_precise_live_drops,
|
||||||
|
const_ptr_cast,
|
||||||
const_raw_ptr_deref,
|
const_raw_ptr_deref,
|
||||||
const_raw_ptr_to_usize_cast,
|
const_raw_ptr_to_usize_cast,
|
||||||
const_refs_to_cell,
|
const_refs_to_cell,
|
||||||
@@ -1159,6 +1160,7 @@ symbols! {
|
|||||||
profiler_runtime,
|
profiler_runtime,
|
||||||
ptr,
|
ptr,
|
||||||
ptr_cast,
|
ptr_cast,
|
||||||
|
ptr_cast_const,
|
||||||
ptr_cast_mut,
|
ptr_cast_mut,
|
||||||
ptr_const_is_null,
|
ptr_const_is_null,
|
||||||
ptr_from_mut,
|
ptr_from_mut,
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ impl<T: ?Sized> *const 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 = "const_ptr_cast"]
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub const fn cast<U>(self) -> *const U {
|
pub const fn cast<U>(self) -> *const U {
|
||||||
self as _
|
self as _
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ impl<T: ?Sized> *mut T {
|
|||||||
/// [`cast_mut`]: #method.cast_mut
|
/// [`cast_mut`]: #method.cast_mut
|
||||||
#[stable(feature = "ptr_const_cast", since = "1.65.0")]
|
#[stable(feature = "ptr_const_cast", since = "1.65.0")]
|
||||||
#[rustc_const_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_const"]
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub const fn cast_const(self) -> *const T {
|
pub const fn cast_const(self) -> *const T {
|
||||||
self as _
|
self as _
|
||||||
|
|||||||
Reference in New Issue
Block a user