Update clippy_lints/src/casts/ptr_cast_constness.rs
Co-authored-by: llogiq <bogusandre@gmail.com>
This commit is contained in:
parent
c5a914b181
commit
f6a0437e74
@ -21,8 +21,8 @@ pub(super) fn check(
|
||||
if msrv.meets(RustcVersion::new(1,65,0));
|
||||
if let ty::RawPtr(TypeAndMut { mutbl: from_mutbl, .. }) = cast_from.kind();
|
||||
if let ty::RawPtr(TypeAndMut { mutbl: to_mutbl, .. }) = cast_to.kind();
|
||||
if !matches!((from_mutbl, to_mutbl),
|
||||
(Mutability::Not, Mutability::Not) | (Mutability::Mut, Mutability::Mut));
|
||||
if matches!((from_mutbl, to_mutbl),
|
||||
(Mutability::Not, Mutability::Mut) | (Mutability::Mut, Mutability::Not));
|
||||
then {
|
||||
let sugg = Sugg::hir(cx, cast_expr, "_");
|
||||
let constness = match *to_mutbl {
|
||||
|
Loading…
x
Reference in New Issue
Block a user