summaryrefslogtreecommitdiffstats
path: root/tests/rust/function_noreturn.rs
blob: d7777adb4671796f34dd4f7c9726a5d02de12462 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[no_mangle]
pub extern "C" fn loop_forever() -> ! {
    loop {}
}

#[no_mangle]
pub extern "C" fn normal_return(arg: Example, other: extern "C" fn(u8) -> !) -> u8 {
    0
}

#[repr(C)]
pub struct Example {
    pub f: extern "C" fn(usize, usize) -> !,
}