]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0437.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0437.md
1 An associated type whose name does not match any of the associated types
2 in the trait was used when implementing the trait.
3
4 Erroneous code example:
5
6 ```compile_fail,E0437
7 trait Foo {}
8
9 impl Foo for i32 {
10     type Bar = bool;
11 }
12 ```
13
14 Trait implementations can only implement associated types that are members of
15 the trait in question.
16
17 The solution to this problem is to remove the extraneous associated type:
18
19 ```
20 trait Foo {}
21
22 impl Foo for i32 {}
23 ```