Skip to content

Commit

Permalink
Uplift TypeAndMut
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Dec 12, 2023
1 parent c8213a4 commit 20de341
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clippy_lints/src/casts/as_ptr_cast_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use super::AS_PTR_CAST_MUT;

pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>, cast_to: Ty<'_>) {
if let ty::RawPtr(
ptrty @ TypeAndMut {
mutbl: Mutability::Mut, ..
TypeAndMut {
mutbl: Mutability::Mut, ty: ptrty,
},
) = cast_to.kind()
&& let ty::RawPtr(TypeAndMut {
Expand All @@ -34,7 +34,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>,
cx,
AS_PTR_CAST_MUT,
expr.span,
&format!("casting the result of `as_ptr` to *{ptrty}"),
&format!("casting the result of `as_ptr` to *mut {ptrty}"),
"replace with",
format!("{recv}.as_mut_ptr()"),
applicability,
Expand Down

0 comments on commit 20de341

Please sign in to comment.