1 An explicit generic argument was provided when calling a function that
2 uses `impl Trait` in argument position.
4 Erroneous code example:
7 fn foo<T: Copy>(a: T, b: impl Clone) {}
9 foo::<i32>(0i32, "abc".to_string());
12 Either all generic arguments should be inferred at the call site, or
13 the function definition should use an explicit generic type parameter
14 instead of `impl Trait`. Example:
17 fn foo<T: Copy>(a: T, b: impl Clone) {}
18 fn bar<T: Copy, U: Clone>(a: T, b: U) {}
20 foo(0i32, "abc".to_string());
22 bar::<i32, String>(0i32, "abc".to_string());
23 bar::<_, _>(0i32, "abc".to_string());
24 bar(0i32, "abc".to_string());