diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-11-15 13:18:05 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-11-15 13:24:47 +0100 |
| commit | 11bb297d2c3f3a28666df15f6be78d35393daf6c (patch) | |
| tree | 67c3d4235c26233217fddbd53ad355287b87aa17 /src/librustc_error_codes/error_codes | |
| parent | a5fcc5137f2b07d176c8d915a2b609462ee3a32c (diff) | |
| download | rust-11bb297d2c3f3a28666df15f6be78d35393daf6c.tar.gz rust-11bb297d2c3f3a28666df15f6be78d35393daf6c.zip | |
Clean up E0045
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0045.md | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/librustc_error_codes/error_codes/E0045.md b/src/librustc_error_codes/error_codes/E0045.md index 537490eb4cf..143c693bf7c 100644 --- a/src/librustc_error_codes/error_codes/E0045.md +++ b/src/librustc_error_codes/error_codes/E0045.md @@ -1,18 +1,18 @@ -Rust only supports variadic parameters for interoperability with C code in its -FFI. As such, variadic parameters can only be used with functions which are -using the C ABI. Examples of erroneous code: - -```compile_fail -#![feature(unboxed_closures)] +Variadic parameters have been used on a non-C ABI function. -extern "rust-call" { fn foo(x: u8, ...); } +Erroneous code example: -// or +```compile_fail,E0045 +#![feature(unboxed_closures)] -fn foo(x: u8, ...) {} +extern "rust-call" { + fn foo(x: u8, ...); // error! +} ``` -To fix such code, put them in an extern "C" block: +Rust only supports variadic parameters for interoperability with C code in its +FFI. As such, variadic parameters can only be used with functions which are +using the C ABI. To fix such code, put them in an extern "C" block: ``` extern "C" { |
