summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.rs
blob: 13c9aa01e34ae8126858fb760bf1b32f37f5d2e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// only-x86
// only-windows
// compile-flags: --crate-type lib --emit link
#![allow(clashing_extern_declarations)]
#![feature(raw_dylib)]
//~^ WARN the feature `raw_dylib` is incomplete
#[link(name = "foo", kind = "raw-dylib")]
extern "C" {
    fn f(x: i32);
}

pub fn lib_main() {
    #[link(name = "foo", kind = "raw-dylib")]
    extern "stdcall" {
        fn f(x: i32);
        //~^ ERROR multiple declarations of external function `f` from library `foo.dll` have different calling conventions
    }

    unsafe { f(42); }
}