diff options
| author | Michael Goulet <michael@errs.io> | 2023-12-12 19:07:19 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-12-12 23:24:44 +0000 |
| commit | 20de341bb0ecc12e573f8e8db779b53916b89851 (patch) | |
| tree | ae78a351fa62982aa5e7ff4b79d9eb99ae85ab53 | |
| parent | c8213a49bb4508c95f29cd5689737c65ac786862 (diff) | |
| download | rust-20de341bb0ecc12e573f8e8db779b53916b89851.tar.gz rust-20de341bb0ecc12e573f8e8db779b53916b89851.zip | |
Uplift TypeAndMut
| -rw-r--r-- | clippy_lints/src/casts/as_ptr_cast_mut.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/casts/as_ptr_cast_mut.rs b/clippy_lints/src/casts/as_ptr_cast_mut.rs index 55294f5f386..b55cd8833b7 100644 --- a/clippy_lints/src/casts/as_ptr_cast_mut.rs +++ b/clippy_lints/src/casts/as_ptr_cast_mut.rs @@ -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 { @@ -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, |
