mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-21 10:33:27 +00:00
22 lines
402 B
Rust
22 lines
402 B
Rust
#![warn(clippy::unnecessary_cast)]
|
|
|
|
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)()
|
|
}
|
|
}
|
|
}
|