Skip to content

Commit 0b9529c

Browse files
committed
Add diagnostic items for <*const _>::cast and ptr::from_mut
1 parent ef3413d commit 0b9529c

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

compiler/rustc_span/src/symbol.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,8 +1155,10 @@ symbols! {
11551155
profiler_builtins,
11561156
profiler_runtime,
11571157
ptr,
1158+
ptr_cast,
11581159
ptr_cast_mut,
11591160
ptr_const_is_null,
1161+
ptr_from_mut,
11601162
ptr_from_ref,
11611163
ptr_guaranteed_cmp,
11621164
ptr_is_null,

library/core/src/ptr/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {
710710
#[inline(always)]
711711
#[must_use]
712712
#[unstable(feature = "ptr_from_ref", issue = "106116")]
713+
#[rustc_diagnostic_item = "ptr_from_mut"]
713714
pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
714715
r
715716
}

library/core/src/ptr/mut_ptr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ impl<T: ?Sized> *mut T {
5454
/// Casts to a pointer of another type.
5555
#[stable(feature = "ptr_cast", since = "1.38.0")]
5656
#[rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0")]
57+
#[rustc_diagnostic_item = "ptr_cast"]
5758
#[inline(always)]
5859
pub const fn cast<U>(self) -> *mut U {
5960
self as _

0 commit comments

Comments
 (0)