]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0743.md
Rollup merge of #106946 - dtolnay:hashlinecolumn, r=m-ou-se
[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 fn foo2(x: u8, y: &...) {} // error!
7 ```
8
9 Only foreign functions can use the C-variadic type (`...`). In such functions,
10 `...` may only occur non-nested. That is, `y: &'a ...` is not allowed.
11
12 A C-variadic type is used to give an undefined number of parameters to a given
13 function (like `printf` in C). The equivalent in Rust would be to use macros
14 directly (like `println!` for example).