Add diagnostic items for <*const _>::cast and <*mut _>::cast_const
This commit is contained in:
@@ -55,6 +55,7 @@ impl<T: ?Sized> *const T {
|
||||
/// Casts to a pointer of another type.
|
||||
#[stable(feature = "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)]
|
||||
pub const fn cast<U>(self) -> *const U {
|
||||
self as _
|
||||
|
||||
@@ -112,6 +112,7 @@ impl<T: ?Sized> *mut T {
|
||||
/// [`cast_mut`]: #method.cast_mut
|
||||
#[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)]
|
||||
pub const fn cast_const(self) -> *const T {
|
||||
self as _
|
||||
|
||||
Reference in New Issue
Block a user