about summary refs log tree commit diff
path: root/tests/codegen/macos/x86_64-macosx-deployment-target.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-07 00:24:45 +0000
committerbors <bors@rust-lang.org>2023-09-07 00:24:45 +0000
commit4e5b31c2b0023dba53a1b2827f4b7ac42aaaa18f (patch)
tree628bbb11a517f98e33e45c1b19da882e077870ec /tests/codegen/macos/x86_64-macosx-deployment-target.rs
parentb0d45536acf8be99036c6a1261359e3cf89f9d63 (diff)
parent89800a27fcbcd15641e06fb870b51c320a78668f (diff)
downloadrust-4e5b31c2b0023dba53a1b2827f4b7ac42aaaa18f.tar.gz
rust-4e5b31c2b0023dba53a1b2827f4b7ac42aaaa18f.zip
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`
Diffstat (limited to 'tests/codegen/macos/x86_64-macosx-deployment-target.rs')
0 files changed, 0 insertions, 0 deletions