mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-17 06:26:55 +00:00
![]() 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).* |
||
---|---|---|
.. | ||
assembly | ||
auxiliary | ||
codegen | ||
codegen-units | ||
debuginfo | ||
incremental | ||
mir-opt | ||
pretty | ||
run-coverage | ||
run-coverage-rustdoc | ||
run-make | ||
run-make-fulldeps | ||
run-pass-valgrind | ||
rustdoc | ||
rustdoc-gui | ||
rustdoc-js | ||
rustdoc-js-std | ||
rustdoc-json | ||
rustdoc-ui | ||
ui | ||
ui-fulldeps | ||
COMPILER_TESTS.md |