]> git.proxmox.com Git - rustc.git/blob - src/test/ui/functions-closures/fn-abi.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / functions-closures / fn-abi.rs
1 // run-pass
2 // Ensure that declarations and types which use `extern fn` both have the same
3 // ABI (#9309).
4
5 // pretty-expanded FIXME #23616
6 // aux-build:fn-abi.rs
7
8 extern crate fn_abi;
9
10 extern "C" {
11 fn foo();
12 }
13
14 pub fn main() {
15 // Will only type check if the type of _p and the decl of foo use the
16 // same ABI
17 let _p: unsafe extern "C" fn() = foo;
18 }