about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-11 08:08:17 +0000
committerbors <bors@rust-lang.org>2022-10-11 08:08:17 +0000
commit8e87d39f992d132354a98d9d3a3e0574c61698b2 (patch)
tree78bb38afa762cc3aefea1d0690ece2d2553e19d3 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parentcf72565a12c982f577ca4394c3b80edb89f6c6d3 (diff)
parent2b944d0c38ebfb99252ccfcb6200db28a217ee07 (diff)
downloadrust-8e87d39f992d132354a98d9d3a3e0574c61698b2.tar.gz
rust-8e87d39f992d132354a98d9d3a3e0574c61698b2.zip
Auto merge of #9572 - Nilstrieb:as-ptr-cast-mut, r=dswij
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`]
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions