about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2023-08-23 05:35:17 +0000
committerGitHub <noreply@github.com>2023-08-23 05:35:17 +0000
commit7257e9c2ded47066b9a9ea76894b25cfc6eb51ca (patch)
tree67ed8f9742038ce7abc17883dba2e1db0a88ff1f /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent391cbdaa7c46c008c067fd944c92f1209cf743e0 (diff)
parent7ee77b5d1b91adf4c683d0d871015fe68ebca9ea (diff)
downloadrust-7257e9c2ded47066b9a9ea76894b25cfc6eb51ca.tar.gz
rust-7257e9c2ded47066b9a9ea76894b25cfc6eb51ca.zip
Rollup merge of #115100 - Urgau:invalid_ref_casting-ptr-writes, r=est31
Add support for `ptr::write`s for the `invalid_reference_casting` lint

This PR adds support for `ptr::write` and others for the `invalid_reference_casting` lint.

Detecting instances where instead of using the deref (`*`) operator to assign someone uses `ptr::write`, `ptr::write_unaligned` or `ptr::write_volatile`.

```rust
let data_len = 5u64;

std::ptr::write(
    std::mem::transmute::<*const u64, *mut u64>(&data_len),
    new_data_len,
);
```

r? ``@est31``
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions