mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
29 lines
443 B
Rust
29 lines
443 B
Rust
//@ run-pass
|
|
//@ only-x86
|
|
|
|
trait A {
|
|
extern "fastcall" fn test1(i: i32);
|
|
extern "C" fn test2(i: i32);
|
|
}
|
|
|
|
struct S;
|
|
impl S {
|
|
extern "stdcall" fn test3(i: i32) {
|
|
assert_eq!(i, 3);
|
|
}
|
|
}
|
|
|
|
impl A for S {
|
|
extern "fastcall" fn test1(i: i32) {
|
|
assert_eq!(i, 1);
|
|
}
|
|
extern "C" fn test2(i: i32) {
|
|
assert_eq!(i, 2);
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
<S as A>::test1(1);
|
|
<S as A>::test2(2);
|
|
S::test3(3);
|
|
}
|