]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0049.md
721a7fd57a51f9d959e4e63711fe87329162267d
[rust.git] / src / librustc_error_codes / error_codes / E0049.md
1 This error indicates that an attempted implementation of a trait method
2 has the wrong number of type or const parameters.
3
4 For example, the trait below has a method `foo` with a type parameter `T`,
5 but the implementation of `foo` for the type `Bar` is missing this parameter:
6
7 ```compile_fail,E0049
8 trait Foo {
9     fn foo<T: Default>(x: T) -> Self;
10 }
11
12 struct Bar;
13
14 // error: method `foo` has 0 type parameters but its trait declaration has 1
15 // type parameter
16 impl Foo for Bar {
17     fn foo(x: bool) -> Self { Bar }
18 }
19 ```