A type or function expects N generics but got a different count.
let v: Vec = Vec::new(); // E0107: missing generic arg
// or
let m: HashMap<String> = ...; // E0107: HashMap takes 2 type args
Generic types declare arity in their definition. Vec<T> requires one type; HashMap<K, V> requires two. The compiler does not infer missing slots in the type ascription.
- Provide the type: let v: Vec<i32> = Vec::new();
- Use turbofish at the call: Vec::<i32>::new().
- Or let inference fill it from context: let v = vec![1, 2, 3];
- For HashMap<K, V>, supply both halves: HashMap<String, i32>.
- Default type parameters can omit some args when defaults exist (Vec<T, A = Global> lets you write Vec<T>).