mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
8e87d39f99
Add `as_ptr_cast_mut` lint This lint detects calls to a `&self`-taking `as_ptr` method, where the result is then immediately cast to a `*mut T`. Code like this is probably invalid, as that pointer will not have write permissions, and `*mut T` is usually used to write through. Examples of broken code with this pattern: https://miri.saethlin.dev/ub?crate=lol_alloc&version=0.1.3 https://miri.saethlin.dev/ub?crate=sophon-wasm&version=0.19.0 https://miri.saethlin.dev/ub?crate=polars-core&version=0.24.2 https://miri.saethlin.dev/ub?crate=ach-cell&version=0.1.17 changelog: Add [`as_ptr_cast_mut`] |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |