diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2019-11-01 11:20:24 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-01 11:20:24 -0700 |
| commit | 1ea66850af013e03295c1ad5e46802dfea4a53bd (patch) | |
| tree | de8ed72e3ebde10d8027b566086eacca32671f4a /src/libsyntax/error_codes.rs | |
| parent | 959a5638031875cda1603a8fd92518753016d51d (diff) | |
| parent | fcbf77ef161435705fb47f63bad5e9d9e54a6980 (diff) | |
| download | rust-1ea66850af013e03295c1ad5e46802dfea4a53bd.tar.gz rust-1ea66850af013e03295c1ad5e46802dfea4a53bd.zip | |
Rollup merge of #65995 - GuillaumeGomez:add-err-code-E0743, r=estebank
Add error code E0743 for "C-variadic has been used on a non-foreign function" Fixes https://github.com/rust-lang/rust/issues/65967
Diffstat (limited to 'src/libsyntax/error_codes.rs')
| -rw-r--r-- | src/libsyntax/error_codes.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libsyntax/error_codes.rs b/src/libsyntax/error_codes.rs index 17ea4767520..941df5ea570 100644 --- a/src/libsyntax/error_codes.rs +++ b/src/libsyntax/error_codes.rs @@ -487,7 +487,6 @@ Erroneous code example: // `test_2018_feature` is // included in the Rust 2018 edition ``` - "##, E0725: r##" @@ -505,6 +504,20 @@ Delete the offending feature attribute, or add it to the list of allowed features in the `-Z allow_features` flag. "##, +E0743: r##" +C-variadic has been used on a non-foreign function. + +Erroneous code example: + +```compile_fail,E0743 +fn foo2(x: u8, ...) {} // error! +``` + +Only foreign functions can use C-variadic (`...`). It is used to give an +undefined number of parameters to a given function (like `printf` in C). The +equivalent in Rust would be to use macros directly. +"##, + ; E0539, // incorrect meta item |
