]> git.lizzy.rs Git - rust.git/blob - tests/ui/panic-runtime/incompatible-type.rs
Move /src/test to /tests
[rust.git] / tests / ui / panic-runtime / incompatible-type.rs
1 // Check that rust_eh_personality can have a different type signature than the
2 // one hardcoded in the compiler.  Regression test for #70117. Used to fail with:
3 //
4 // Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
5 //
6 // build-pass
7 // compile-flags: --crate-type=lib -Ccodegen-units=1
8 #![no_std]
9 #![panic_runtime]
10 #![feature(panic_runtime)]
11 #![feature(rustc_attrs)]
12
13 pub struct DropMe;
14
15 impl Drop for DropMe {
16     fn drop(&mut self) {}
17 }
18
19 pub fn test(_: DropMe) {
20     unreachable!();
21 }
22
23 #[rustc_std_internal_symbol]
24 pub unsafe extern "C" fn rust_eh_personality() {}