rust-clippy/tests/ui/unnecessary_cast_unfixable.rs
2023-08-11 14:02:28 +00:00

22 lines
415 B
Rust

#![warn(clippy::unnecessary_cast)]
//@no-rustfix
fn main() {
let _ = std::ptr::null() as *const u8;
}
mod issue11113 {
#[repr(C)]
struct Vtbl {
query: unsafe extern "system" fn(),
}
struct TearOff {
object: *mut std::ffi::c_void,
}
impl TearOff {
unsafe fn query(&self) {
((*(*(self.object as *mut *mut _) as *mut Vtbl)).query)()
}
}
}