Why must the generic parameter list in an impl block be the same as the generic parameter list in a struct?
struct StructName<T, U> { field1: T, field2: U, } impl<T, U> StructName<T, U> { } As in the code above, the generic argument list in the impl block and the struct generic argument list must match, otherwise the Rust compiler will give an error. I have three questions: Why do they need to be consistent? […]