E0107type-check

Wrong number of generic arguments

A type or function expects N generics but got a different count.

Repro

let v: Vec = Vec::new();          // E0107: missing generic arg
// or
let m: HashMap<String> = ...;     // E0107: HashMap takes 2 type args

Why

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.

Fix

- 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>).

Patterns that solve this