diff options
| author | Urgau <urgau@numericable.fr> | 2023-08-24 12:04:40 +0200 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2023-08-24 15:00:21 +0200 |
| commit | 89800a27fcbcd15641e06fb870b51c320a78668f (patch) | |
| tree | ad1701d984abee970b8d2b03bee9bedbbb586dd7 /library/core | |
| parent | 9bd60a60cefdddca1f507083dda37e1664b295c5 (diff) | |
| download | rust-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.rs | 1 |
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 |
