Skip to content

Commit ccb459e

Browse files
Change description of error (thanks @Manisheart)
1 parent 11f0f47 commit ccb459e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,19 +381,24 @@ fn main() {
381381
"##,
382382

383383
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:
386387
387388
```
388389
extern "rust-call" { fn foo(x: u8, ...); }
389390
// or
390391
fn foo(x: u8, ...) {}
391392
```
392393
393-
To fix such code, put them in extern "C" block:
394+
To fix such code, put them in an extern "C" block:
394395
395396
```
396397
extern "C" fn foo (x: u8, ...);
398+
// or:
399+
extern "C" {
400+
fn foo (x: u8, ...);
401+
}
397402
```
398403
"##,
399404

0 commit comments

Comments
 (0)