Uplift TypeAndMut

This commit is contained in:
Michael Goulet 2023-12-12 19:07:19 +00:00
parent c8213a49bb
commit 20de341bb0

View File

@ -10,8 +10,8 @@
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,