bors
4e5b31c2b0
Auto merge of #115166 - Urgau:invalid_ref_casting-invalid-unsafecell-usage, r=est31
...
Lint on invalid usage of `UnsafeCell::raw_get` in reference casting
This PR proposes to take into account `UnsafeCell::raw_get` method call for non-Freeze types for the `invalid_reference_casting` lint.
The goal of this is to catch those kind of invalid reference casting:
```rust
fn as_mut<T>(x: &T) -> &mut T {
unsafe { &mut *std::cell::UnsafeCell::raw_get(x as *const _ as *const _) }
//~^ ERROR casting `&T` to `&mut T` is undefined behavior
}
```
r? `@est31`
2023-09-07 00:24:45 +00:00
..
2023-08-10 22:57:48 +02:00
2023-09-04 14:21:38 +02:00
2023-08-04 16:46:08 +00:00
2023-08-14 12:05:53 -07:00
2023-09-03 08:21:18 +05:30
2023-08-04 16:09:13 +00:00
2023-09-04 14:21:38 +02:00
2023-09-04 14:21:38 +02:00
2023-09-04 14:21:38 +02:00
2023-07-01 16:05:55 +02:00
2023-07-01 16:05:55 +02:00
2023-09-04 14:21:38 +02:00
2023-07-21 22:35:57 -07:00
2023-08-05 23:54:59 +02:00
2023-08-04 16:09:13 +00:00
2023-08-02 13:40:28 +03:00
2023-07-07 13:17:00 +00:00
2023-08-04 16:09:14 +00:00
2023-08-04 16:09:14 +00:00
2023-07-28 11:11:29 +02:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-07-03 13:40:20 +01:00
2023-07-03 13:40:20 +01:00
2023-07-19 09:59:04 +01:00
2023-07-19 09:59:04 +01:00
2023-07-19 09:59:04 +01:00
2023-07-21 15:42:25 +01:00
2023-08-02 13:40:28 +03:00
2023-08-02 13:40:28 +03:00
2023-08-04 16:09:14 +00:00
2023-09-04 14:21:38 +02:00
2023-07-18 09:52:08 +08:00
2023-07-18 09:52:08 +08:00
2023-07-18 09:52:08 +08:00
2023-08-14 18:05:13 +08:00
2023-08-14 18:05:13 +08:00
2023-07-22 14:04:45 +02:00
2023-07-22 14:04:45 +02:00
2023-08-04 13:17:39 +02:00
2023-08-03 01:37:42 +02:00
2023-08-04 16:09:14 +00:00
2023-07-23 09:58:31 +00:00
2023-07-23 09:58:31 +00:00
2023-07-23 09:58:31 +00:00
2023-06-16 19:39:48 +00:00
2023-06-16 19:39:48 +00:00
2023-08-03 10:52:15 +02:00
2023-08-03 10:57:11 +02:00
2023-08-24 15:00:21 +02:00
2023-08-24 15:00:21 +02:00
2023-07-23 09:58:31 +00:00
2023-07-23 09:58:31 +00:00
2023-07-10 20:09:26 +00:00