about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-11 15:43:48 +0000
committerbors <bors@rust-lang.org>2024-09-11 15:43:48 +0000
commit131681b4b9c2460d223b5939a273f0356a8e06f5 (patch)
tree4d35958f14cc1d48d99b12e56d3ef1aead844bfa /compiler/rustc_codegen_llvm/src
parent8be0b36687d8776ddb0dde19de63640be03d91f0 (diff)
parent30608732c2f68c423e4a62e6c20cdf28f6d38559 (diff)
downloadrust-131681b4b9c2460d223b5939a273f0356a8e06f5.tar.gz
rust-131681b4b9c2460d223b5939a273f0356a8e06f5.zip
Auto merge of #13369 - samueltardieu:issue-13361, r=y21
Special-case suggestions for null pointers constness cast

This implements the suggestions from #13361. It fits into the existing `ptr_cast_constness` lint, as this is a specialized version. However,

1. I have not modified the lint MSRV, so the documentation for this lint will still show that it applies only from Rust 1.72.0. This is true in the general case, but the lint for null pointers will trigger even before this version as `null()` and `null_mut()` were already present in Rust 1.0 and there is no reason not to apply this lint. I guess this is only a minor documentation issue that can be ignored.
2. I have not covered the `core::ptr::null::<T>().cast_mut()` (could be made into `core::ptr::null_mut::<T>()`) and `cotr::ptr::null_mut::<T>().cast_const()` (could be made into `core::ptr::null::<T>()`) cases. Should they be covered? If they should, here or in a separate PR?

changelog: [`ptr_cast_constness`]: special-case suggestions for null pointers constness cast

Fix #13361
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions