File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -381,19 +381,24 @@ fn main() {
381
381
"## ,
382
382
383
383
E0045 : r##"
384
- Variadic parameters are only allowed in extern "C" code. Examples of
385
- erroneous code:
384
+ Rust only supports variadic parameters for interoperability with C code in its
385
+ FFI. As such, variadic parameters can only be used with functions which are
386
+ using the C ABI. Examples of erroneous code:
386
387
387
388
```
388
389
extern "rust-call" { fn foo(x: u8, ...); }
389
390
// or
390
391
fn foo(x: u8, ...) {}
391
392
```
392
393
393
- To fix such code, put them in extern "C" block:
394
+ To fix such code, put them in an extern "C" block:
394
395
395
396
```
396
397
extern "C" fn foo (x: u8, ...);
398
+ // or:
399
+ extern "C" {
400
+ fn foo (x: u8, ...);
401
+ }
397
402
```
398
403
"## ,
399
404
You can’t perform that action at this time.
0 commit comments