2024-03-22 13:21:50 -05:00
|
|
|
// test for ICE when casting extern "C" fn when it has a non-FFI-safe argument
|
|
|
|
// issue: rust-lang/rust#52334
|
2024-03-22 11:49:04 -05:00
|
|
|
//@ check-pass
|
2024-06-21 00:15:36 -05:00
|
|
|
//@ normalize-stderr-test: "\[i8\]" -> "[i8 or u8 (arch dependant)]"
|
|
|
|
//@ normalize-stderr-test: "\[u8\]" -> "[i8 or u8 (arch dependant)]"
|
2024-03-22 11:49:04 -05:00
|
|
|
|
|
|
|
type Foo = extern "C" fn(::std::ffi::CStr);
|
2024-03-22 13:21:50 -05:00
|
|
|
//~^ WARN `extern` fn uses type
|
2024-03-22 11:49:04 -05:00
|
|
|
extern "C" {
|
|
|
|
fn meh(blah: Foo);
|
2024-03-22 13:21:50 -05:00
|
|
|
//~^ WARN `extern` block uses type
|
2024-03-22 11:49:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
meh as usize;
|
|
|
|
}
|