Skip to content

Commit 6933848

Browse files
committed
Add diagnostic items for <*const _>::cast and <*mut _>::cast_const
1 parent 570601f commit 6933848

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

compiler/rustc_span/src/symbol.rs

+2
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ symbols! {
543543
const_panic_fmt,
544544
const_param_ty,
545545
const_precise_live_drops,
546+
const_ptr_cast,
546547
const_raw_ptr_deref,
547548
const_raw_ptr_to_usize_cast,
548549
const_refs_to_cell,
@@ -1159,6 +1160,7 @@ symbols! {
11591160
profiler_runtime,
11601161
ptr,
11611162
ptr_cast,
1163+
ptr_cast_const,
11621164
ptr_cast_mut,
11631165
ptr_const_is_null,
11641166
ptr_from_mut,

library/core/src/ptr/const_ptr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ impl<T: ?Sized> *const T {
5555
/// Casts to a pointer of another type.
5656
#[stable(feature = "ptr_cast", since = "1.38.0")]
5757
#[rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0")]
58+
#[rustc_diagnostic_item = "const_ptr_cast"]
5859
#[inline(always)]
5960
pub const fn cast<U>(self) -> *const U {
6061
self as _

library/core/src/ptr/mut_ptr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ impl<T: ?Sized> *mut T {
112112
/// [`cast_mut`]: #method.cast_mut
113113
#[stable(feature = "ptr_const_cast", since = "1.65.0")]
114114
#[rustc_const_stable(feature = "ptr_const_cast", since = "1.65.0")]
115+
#[rustc_diagnostic_item = "ptr_cast_const"]
115116
#[inline(always)]
116117
pub const fn cast_const(self) -> *const T {
117118
self as _

0 commit comments

Comments
 (0)