]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0632.md
Rollup merge of #102215 - alexcrichton:wasm-link-whole-archive, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0632.md
1 #### Note: this error code is no longer emitted by the compiler.
2
3 An explicit generic argument was provided when calling a function that
4 uses `impl Trait` in argument position.
5
6 Erroneous code example:
7
8 ```ignore (no longer an error)
9 fn foo<T: Copy>(a: T, b: impl Clone) {}
10
11 foo::<i32>(0i32, "abc".to_string());
12 ```
13
14 Either all generic arguments should be inferred at the call site, or
15 the function definition should use an explicit generic type parameter
16 instead of `impl Trait`. Example:
17
18 ```
19 fn foo<T: Copy>(a: T, b: impl Clone) {}
20 fn bar<T: Copy, U: Clone>(a: T, b: U) {}
21
22 foo(0i32, "abc".to_string());
23
24 bar::<i32, String>(0i32, "abc".to_string());
25 bar::<_, _>(0i32, "abc".to_string());
26 bar(0i32, "abc".to_string());
27 ```