]> git.proxmox.com Git - rustc.git/blame - src/test/ui/panic-runtime/incompatible-type.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / panic-runtime / incompatible-type.rs
CommitLineData
136023e0
XL
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
13pub struct DropMe;
14
15impl Drop for DropMe {
16 fn drop(&mut self) {}
17}
18
19pub fn test(_: DropMe) {
20 unreachable!();
21}
22
23#[rustc_std_internal_symbol]
24pub unsafe extern "C" fn rust_eh_personality() {}