]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2627-raw-dylib/multiple-declarations.rs
Rollup merge of #105983 - compiler-errors:issue-105981, r=tmiasko
[rust.git] / src / test / ui / rfc-2627-raw-dylib / multiple-declarations.rs
1 // only-x86
2 // only-windows
3 // compile-flags: --crate-type lib --emit link
4 #![allow(clashing_extern_declarations)]
5 #![feature(raw_dylib)]
6 #[link(name = "foo", kind = "raw-dylib")]
7 extern "C" {
8     fn f(x: i32);
9 }
10
11 pub fn lib_main() {
12     #[link(name = "foo", kind = "raw-dylib")]
13     extern "stdcall" {
14         fn f(x: i32);
15         //~^ ERROR multiple declarations of external function `f` from library `foo.dll` have different calling conventions
16     }
17
18     unsafe { f(42); }
19 }