mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-28 21:55:31 +00:00
21 lines
448 B
Rust
21 lines
448 B
Rust
//! Check that `vtable_size` gets overridden by llvm backend even if there is a
|
|
//! fallback body.
|
|
#![feature(intrinsics)]
|
|
//@run-pass
|
|
|
|
#[rustc_intrinsic]
|
|
pub unsafe fn vtable_size(_ptr: *const ()) -> usize {
|
|
panic!();
|
|
}
|
|
|
|
trait Trait {}
|
|
impl Trait for () {}
|
|
|
|
fn main() {
|
|
let x: &dyn Trait = &();
|
|
unsafe {
|
|
let (_data, vtable): (*const (), *const ()) = core::mem::transmute(x);
|
|
assert_eq!(vtable_size(vtable), 0);
|
|
}
|
|
}
|