diff --git a/tests/ui/as_ptr_cast_mut.rs b/tests/ui/as_ptr_cast_mut.rs index 938942623..7d71947e4 100644 --- a/tests/ui/as_ptr_cast_mut.rs +++ b/tests/ui/as_ptr_cast_mut.rs @@ -1,7 +1,6 @@ -//@run-rustfix #![allow(unused)] #![warn(clippy::as_ptr_cast_mut)] -#![allow(clippy::wrong_self_convention)] +#![allow(clippy::wrong_self_convention, clippy::unnecessary_cast)] struct MutPtrWrapper(Vec); impl MutPtrWrapper { diff --git a/tests/ui/as_ptr_cast_mut.stderr b/tests/ui/as_ptr_cast_mut.stderr index c45d669fd..2189c3d2f 100644 --- a/tests/ui/as_ptr_cast_mut.stderr +++ b/tests/ui/as_ptr_cast_mut.stderr @@ -12,19 +12,5 @@ error: casting the result of `as_ptr` to *mut i8 LL | let _: *mut i8 = string.as_ptr() as *mut _; | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `string.as_mut_ptr()` -error: casting raw pointers to the same type and constness is unnecessary (`*mut u8` -> `*mut u8`) - --> $DIR/as_ptr_cast_mut.rs:25:13 - | -LL | let _ = string.as_mut_ptr() as *mut u8; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `string.as_mut_ptr()` - | - = note: `-D clippy::unnecessary-cast` implied by `-D warnings` - -error: casting raw pointers to the same type and constness is unnecessary (`*mut u8` -> `*mut u8`) - --> $DIR/as_ptr_cast_mut.rs:29:13 - | -LL | let _ = nn.as_ptr() as *mut u8; - | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `nn.as_ptr()` - -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors