rust/tests/ui/extern/extern-methods.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
441 B
Rust
Raw Normal View History

// run-pass
// only-x86
2016-10-25 12:56:36 -05:00
2015-04-18 00:12:20 -05:00
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);
}