2023-07-13 08:29:41 -05:00
|
|
|
#![warn(clippy::unnecessary_cast)]
|
2023-07-27 06:40:22 -05:00
|
|
|
//@no-rustfix
|
2023-07-13 08:29:41 -05:00
|
|
|
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)()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|