Skip to content

Commit a51ad13

Browse files
committed
Add diagnostic items for ptr::cast_mut and ptr::from_ref
1 parent 617d3d6 commit a51ad13

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
@@ -1146,6 +1146,8 @@ symbols! {
11461146
profiler_builtins,
11471147
profiler_runtime,
11481148
ptr,
1149+
ptr_cast_mut,
1150+
ptr_from_ref,
11491151
ptr_guaranteed_cmp,
11501152
ptr_mask,
11511153
ptr_null,

library/core/src/ptr/const_ptr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ impl<T: ?Sized> *const T {
104104
/// refactored.
105105
#[stable(feature = "ptr_const_cast", since = "1.65.0")]
106106
#[rustc_const_stable(feature = "ptr_const_cast", since = "1.65.0")]
107+
#[rustc_diagnostic_item = "ptr_cast_mut"]
107108
#[inline(always)]
108109
pub const fn cast_mut(self) -> *mut T {
109110
self as _

library/core/src/ptr/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ where
698698
#[inline(always)]
699699
#[must_use]
700700
#[unstable(feature = "ptr_from_ref", issue = "106116")]
701+
#[rustc_diagnostic_item = "ptr_from_ref"]
701702
pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {
702703
r
703704
}

0 commit comments

Comments
 (0)