]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0089.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0089.md
1 #### Note: this error code is no longer emitted by the compiler.
2
3 Too few type arguments were supplied for a function. For example:
4
5 ```compile_fail,E0107
6 fn foo<T, U>() {}
7
8 fn main() {
9     foo::<f64>(); // error: wrong number of type arguments: expected 2, found 1
10 }
11 ```
12
13 Note that if a function takes multiple type arguments but you want the compiler
14 to infer some of them, you can use type placeholders:
15
16 ```compile_fail,E0107
17 fn foo<T, U>(x: T) {}
18
19 fn main() {
20     let x: bool = true;
21     foo::<f64>(x);    // error: wrong number of type arguments:
22                       //        expected 2, found 1
23     foo::<_, f64>(x); // same as `foo::<bool, f64>(x)`
24 }
25 ```