]> git.lizzy.rs Git - rust.git/blob - tests/ui/abi/issues/issue-22565-rust-call.rs
Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic
[rust.git] / tests / ui / abi / issues / issue-22565-rust-call.rs
1 #![feature(unboxed_closures)]
2
3 extern "rust-call" fn b(_i: i32) {}
4 //~^ ERROR functions with the "rust-call" ABI must take a single non-self tuple argument
5
6 trait Tr {
7     extern "rust-call" fn a();
8     //~^ ERROR functions with the "rust-call" ABI must take a single non-self tuple argument
9
10     extern "rust-call" fn b() {}
11     //~^ ERROR functions with the "rust-call" ABI must take a single non-self tuple argument
12 }
13
14 struct Foo;
15
16 impl Foo {
17     extern "rust-call" fn bar() {}
18     //~^ ERROR functions with the "rust-call" ABI must take a single non-self tuple argument
19 }
20
21 impl Tr for Foo {
22     extern "rust-call" fn a() {}
23     //~^ ERROR functions with the "rust-call" ABI must take a single non-self tuple argument
24 }
25
26 fn main() {
27     b(10);
28     Foo::bar();
29     <Foo as Tr>::a();
30     <Foo as Tr>::b();
31 }