Files
rust/library
Jacob Pratt 1b03eec78c Rollup merge of #159960 - Urgau:invalid_ref-safe-interior-mut, r=mejrs
Allow `UnsafeCell` content access without `get` in `invalid_reference_casting` lint

https://github.com/rust-lang/rust/pull/159730 relaxed the rules so that it's no longer necessary to use `UnsafeCell::raw_get` or `UnsafeCell::get` to access the content of an unsafe cell.

As a consequence this means that code this like is no longer invalid:
```rust
use std::cell::UnsafeCell;

unsafe fn get_mut_unchecked<T>(ptr: &UnsafeCell<T>) -> &mut T {
    let t = ptr as *const UnsafeCell<T> as *mut T;
    unsafe { &mut *t }
}
```

Fixes https://github.com/rust-lang/rust/issues/159915
cc @RalfJung
2026-07-28 01:38:30 -04:00
..
2026-07-26 04:23:22 +00:00
2026-06-02 19:56:40 +02:00
2026-07-20 10:49:36 +02:00
2026-07-27 11:32:43 +02:00
2026-07-22 10:49:07 +08:00