]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0324.md
Auto merge of #66396 - smmalis37:pythontest, r=alexcrichton
[rust.git] / src / librustc_error_codes / error_codes / E0324.md
1 A method was implemented when another trait item was expected. Erroneous
2 code example:
3
4 ```compile_fail,E0324
5 struct Bar;
6
7 trait Foo {
8     const N : u32;
9
10     fn M();
11 }
12
13 impl Foo for Bar {
14     fn N() {}
15     // error: item `N` is an associated method, which doesn't match its
16     //        trait `<Bar as Foo>`
17 }
18 ```
19
20 To fix this error, please verify that the method name wasn't misspelled and
21 verify that you are indeed implementing the correct trait items. Example:
22
23 ```
24 struct Bar;
25
26 trait Foo {
27     const N : u32;
28
29     fn M();
30 }
31
32 impl Foo for Bar {
33     const N : u32 = 0;
34
35     fn M() {} // ok!
36 }
37 ```