]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0437.md
Update const_forget.rs
[rust.git] / src / librustc_error_codes / error_codes / E0437.md
1 Trait implementations can only implement associated types that are members of
2 the trait in question. This error indicates that you attempted to implement
3 an associated type whose name does not match the name of any associated type
4 in the trait.
5
6 Erroneous code example:
7
8 ```compile_fail,E0437
9 trait Foo {}
10
11 impl Foo for i32 {
12     type Bar = bool;
13 }
14 ```
15
16 The solution to this problem is to remove the extraneous associated type:
17
18 ```
19 trait Foo {}
20
21 impl Foo for i32 {}
22 ```