rust/tests/ui/extern/extern-C-non-FFI-safe-arg-ice-52334.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
450 B
Rust
Raw Normal View History

// 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
//@ 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);
//~^ WARN `extern` fn uses type
2024-03-22 11:49:04 -05:00
extern "C" {
fn meh(blah: Foo);
//~^ WARN `extern` block uses type
2024-03-22 11:49:04 -05:00
}
fn main() {
meh as usize;
}