We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5a914b commit f6a0437Copy full SHA for f6a0437
clippy_lints/src/casts/ptr_cast_constness.rs
@@ -21,8 +21,8 @@ pub(super) fn check(
21
if msrv.meets(RustcVersion::new(1,65,0));
22
if let ty::RawPtr(TypeAndMut { mutbl: from_mutbl, .. }) = cast_from.kind();
23
if let ty::RawPtr(TypeAndMut { mutbl: to_mutbl, .. }) = cast_to.kind();
24
- if !matches!((from_mutbl, to_mutbl),
25
- (Mutability::Not, Mutability::Not) | (Mutability::Mut, Mutability::Mut));
+ if matches!((from_mutbl, to_mutbl),
+ (Mutability::Not, Mutability::Mut) | (Mutability::Mut, Mutability::Not));
26
then {
27
let sugg = Sugg::hir(cx, cast_expr, "_");
28
let constness = match *to_mutbl {
0 commit comments