]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0324.md
New upstream version 1.43.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0324.md
CommitLineData
74b04a01
XL
1A method was implemented when another trait item was expected.
2
3Erroneous code example:
60c5eb7d
XL
4
5```compile_fail,E0324
6struct Bar;
7
8trait Foo {
9 const N : u32;
10
11 fn M();
12}
13
14impl Foo for Bar {
15 fn N() {}
16 // error: item `N` is an associated method, which doesn't match its
17 // trait `<Bar as Foo>`
18}
19```
20
21To fix this error, please verify that the method name wasn't misspelled and
22verify that you are indeed implementing the correct trait items. Example:
23
24```
25struct Bar;
26
27trait Foo {
28 const N : u32;
29
30 fn M();
31}
32
33impl Foo for Bar {
34 const N : u32 = 0;
35
36 fn M() {} // ok!
37}
38```