]> git.lizzy.rs Git - rust.git/blob - tests/ui/functions-closures/fn-abi.rs
Rollup merge of #106664 - chenyukang:yukang/fix-106597-remove-lseek, r=cuviper
[rust.git] / tests / 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 }