about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-08 06:32:58 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2019-12-12 18:05:05 +0100
commit74d4fbc5f5f68212d01a78738c207d5976fe13e4 (patch)
treef59091dcccb1661904d10849a1a896f98a2b8051 /src/librustc_error_codes/error_codes
parente52f902a8ab3a1abbb200607db4766d95b27bc8e (diff)
downloadrust-74d4fbc5f5f68212d01a78738c207d5976fe13e4.tar.gz
rust-74d4fbc5f5f68212d01a78738c207d5976fe13e4.zip
De-fatalize `...` parsing.
Also fix error the code description.
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0743.md16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/librustc_error_codes/error_codes/E0743.md b/src/librustc_error_codes/error_codes/E0743.md
index aaf19d8478c..1780fe59cbd 100644
--- a/src/librustc_error_codes/error_codes/E0743.md
+++ b/src/librustc_error_codes/error_codes/E0743.md
@@ -1,11 +1,17 @@
-C-variadic has been used on a non-foreign function.
+The C-variadic type `...` has been nested inside another type.
 
 Erroneous code example:
 
 ```compile_fail,E0743
-fn foo2(x: u8, ...) {} // error!
+#![feature(c_variadic)]
+
+fn foo2(x: u8, y: &...) {} // 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.
+Only foreign functions can use the C-variadic type (`...`).
+In such functions, `...` may only occur non-nested.
+That is, `y: &'a ...` is not allowed.
+
+A C-variadic type 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.