]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0437.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0437.md
CommitLineData
ba9703b0
XL
1An associated type whose name does not match any of the associated types
2in the trait was used when implementing the trait.
60c5eb7d
XL
3
4Erroneous code example:
5
6```compile_fail,E0437
7trait Foo {}
8
9impl Foo for i32 {
10 type Bar = bool;
11}
12```
13
ba9703b0
XL
14Trait implementations can only implement associated types that are members of
15the trait in question.
16
60c5eb7d
XL
17The solution to this problem is to remove the extraneous associated type:
18
19```
20trait Foo {}
21
22impl Foo for i32 {}
23```