]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0130.md
Rollup merge of #66411 - RalfJung:forget, r=sfackler
[rust.git] / src / librustc_error_codes / error_codes / E0130.md
1 You declared a pattern as an argument in a foreign function declaration.
2
3 Erroneous code example:
4
5 ```compile_fail
6 extern {
7     fn foo((a, b): (u32, u32)); // error: patterns aren't allowed in foreign
8                                 //        function declarations
9 }
10 ```
11
12 Please replace the pattern argument with a regular one. Example:
13
14 ```
15 struct SomeStruct {
16     a: u32,
17     b: u32,
18 }
19
20 extern {
21     fn foo(s: SomeStruct); // ok!
22 }
23 ```
24
25 Or:
26
27 ```
28 extern {
29     fn foo(a: (u32, u32)); // ok!
30 }
31 ```