mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-14 17:48:10 +00:00
30 lines
441 B
Rust
30 lines
441 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);
|
|
}
|