about summary refs log tree commit diff
path: root/library/core
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-08-24 12:04:40 +0200
committerUrgau <urgau@numericable.fr>2023-08-24 15:00:21 +0200
commit89800a27fcbcd15641e06fb870b51c320a78668f (patch)
treead1701d984abee970b8d2b03bee9bedbbb586dd7 /library/core
parent9bd60a60cefdddca1f507083dda37e1664b295c5 (diff)
downloadrust-89800a27fcbcd15641e06fb870b51c320a78668f.tar.gz
rust-89800a27fcbcd15641e06fb870b51c320a78668f.zip
Lint on invalid UnsafeCell::raw_get with invalid_reference_casting lint
Diffstat (limited to 'library/core')
-rw-r--r--library/core/src/cell.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index bf4c682d33e..5bbe2f22efb 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -2131,6 +2131,7 @@ impl<T: ?Sized> UnsafeCell<T> {
     #[inline(always)]
     #[stable(feature = "unsafe_cell_raw_get", since = "1.56.0")]
     #[rustc_const_stable(feature = "unsafe_cell_raw_get", since = "1.56.0")]
+    #[rustc_diagnostic_item = "unsafe_cell_raw_get"]
     pub const fn raw_get(this: *const Self) -> *mut T {
         // We can just cast the pointer from `UnsafeCell<T>` to `T` because of
         // #[repr(transparent)]. This exploits std's special status, there is