mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
26 lines
321 B
Rust
26 lines
321 B
Rust
// run-pass
|
|
// only-x86
|
|
|
|
#![feature(abi_thiscall)]
|
|
|
|
trait A {
|
|
extern "thiscall" fn test1(i: i32);
|
|
}
|
|
|
|
struct S;
|
|
|
|
impl A for S {
|
|
extern "thiscall" fn test1(i: i32) {
|
|
assert_eq!(i, 1);
|
|
}
|
|
}
|
|
|
|
extern "thiscall" fn test2(i: i32) {
|
|
assert_eq!(i, 2);
|
|
}
|
|
|
|
fn main() {
|
|
<S as A>::test1(1);
|
|
test2(2);
|
|
}
|