mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 17:53:56 +00:00
570601f0aa
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).* |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |