]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0326.md
Update const_forget.rs
[rust.git] / src / librustc_error_codes / error_codes / E0326.md
1 An implementation of a trait doesn't match the type contraint.
2
3 Erroneous code example:
4
5 ```compile_fail,E0326
6 trait Foo {
7     const BAR: bool;
8 }
9
10 struct Bar;
11
12 impl Foo for Bar {
13     const BAR: u32 = 5; // error, expected bool, found u32
14 }
15 ```
16
17 The types of any associated constants in a trait implementation must match the
18 types in the trait definition.