]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0743.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0743.md
1 The C-variadic type `...` has been nested inside another type.
2
3 Erroneous code example:
4
5 ```compile_fail,E0743
6 #![feature(c_variadic)]
7
8 fn foo2(x: u8, y: &...) {} // error!
9 ```
10
11 Only foreign functions can use the C-variadic type (`...`). In such functions,
12 `...` may only occur non-nested. That is, `y: &'a ...` is not allowed.
13
14 A C-variadic type is used to give an undefined number of parameters to a given
15 function (like `printf` in C). The equivalent in Rust would be to use macros
16 directly (like `println!` for example).