about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-13 12:46:00 +0000
committerbors <bors@rust-lang.org>2023-08-13 12:46:00 +0000
commit570601f0aad3e0f07f14684d5cbedd1c1c96b1c9 (patch)
tree45686f2fde8a9b8c4d0ba226537e685cc8412de6 /compiler/rustc_codegen_llvm/src
parent5f3abbc52fc460c05f24648cce3969a41c0b02e9 (diff)
parentb517dd5bc9b8866d63fb63715364a929315c1c78 (diff)
downloadrust-570601f0aad3e0f07f14684d5cbedd1c1c96b1c9.tar.gz
rust-570601f0aad3e0f07f14684d5cbedd1c1c96b1c9.zip
Auto merge of #114757 - Urgau:transmute-with-invalid_reference_casting, r=est31
Also consider `mem::transmute` with the `invalid_reference_casting` lint

This PR extend the `invalid_reference_casting` lint with regard to the `std::mem::transmute` function.

```
error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
  --> $DIR/reference_casting.rs:27:16
   |
LL |     let _num = &mut *std::mem::transmute::<_, *mut i32>(&num);
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

*I encourage anyone reviewing this PR to do so [without whitespaces](https://github.blog/2011-10-21-github-secrets/#whitespace).*
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions