1 An attempted implementation of a trait method has the wrong number of type or
4 Erroneous code example:
8 fn foo<T: Default>(x: T) -> Self;
13 // error: method `foo` has 0 type parameters but its trait declaration has 1
16 fn foo(x: bool) -> Self { Bar }
20 For example, the `Foo` trait has a method `foo` with a type parameter `T`,
21 but the implementation of `foo` for the type `Bar` is missing this parameter.
22 To fix this error, they must have the same type parameters:
26 fn foo<T: Default>(x: T) -> Self;
32 fn foo<T: Default>(x: T) -> Self { // ok!