mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-16 17:58:14 +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`] |
||
---|---|---|
.. | ||
test_utils | ||
ui | ||
ui-cargo | ||
ui-internal | ||
ui-toml | ||
workspace_test | ||
check-fmt.rs | ||
clippy.toml | ||
compile-test.rs | ||
dogfood.rs | ||
integration.rs | ||
lint_message_convention.rs | ||
missing-test-files.rs | ||
versioncheck.rs | ||
workspace.rs |