File tree 1 file changed +10
-10
lines changed
src/librustc_error_codes/error_codes 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 1
- Rust only supports variadic parameters for interoperability with C code in its
2
- FFI. As such, variadic parameters can only be used with functions which are
3
- using the C ABI. Examples of erroneous code:
4
-
5
- ``` compile_fail
6
- #![feature(unboxed_closures)]
1
+ Variadic parameters have been used on a non-C ABI function.
7
2
8
- extern "rust-call" { fn foo(x: u8, ...); }
3
+ Erroneous code example:
9
4
10
- // or
5
+ ``` compile_fail,E0045
6
+ #![feature(unboxed_closures)]
11
7
12
- fn foo(x: u8, ...) {}
8
+ extern "rust-call" {
9
+ fn foo(x: u8, ...); // error!
10
+ }
13
11
```
14
12
15
- To fix such code, put them in an extern "C" block:
13
+ Rust only supports variadic parameters for interoperability with C code in its
14
+ FFI. As such, variadic parameters can only be used with functions which are
15
+ using the C ABI. To fix such code, put them in an extern "C" block:
16
16
17
17
```
18
18
extern "C" {
You can’t perform that action at this time.
0 commit comments