rust/tests/ui/unnecessary_cast_unfixable.stderr
Alex Macleod ea36a9df75 Set unnecessary_cast suggestion to MaybeIncorrect for pointer casts
Removing casts may cause type inference to stop working which requires
manual intervention
2023-07-13 13:29:41 +00:00

17 lines
756 B
Plaintext

error: casting raw pointers to the same type and constness is unnecessary (`*const u8` -> `*const u8`)
--> $DIR/unnecessary_cast_unfixable.rs:4:13
|
LL | let _ = std::ptr::null() as *const u8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::null()`
|
= note: `-D clippy::unnecessary-cast` implied by `-D warnings`
error: casting raw pointers to the same type and constness is unnecessary (`*mut issue11113::Vtbl` -> `*mut issue11113::Vtbl`)
--> $DIR/unnecessary_cast_unfixable.rs:19:16
|
LL | ((*(*(self.object as *mut *mut _) as *mut Vtbl)).query)()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `*(self.object as *mut *mut _)`
error: aborting due to 2 previous errors