File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 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.
72
8- extern "rust-call" { fn foo(x: u8, ...); }
3+ Erroneous code example:
94
10- // or
5+ ``` compile_fail,E0045
6+ #![feature(unboxed_closures)]
117
12- fn foo(x: u8, ...) {}
8+ extern "rust-call" {
9+ fn foo(x: u8, ...); // error!
10+ }
1311```
1412
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:
1616
1717```
1818extern "C" {
You can’t perform that action at this time.
0 commit comments