mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
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 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |