Skip to content

Commit d50fa7e

Browse files
author
Nick Hamann
committed
Add error explanation for E0326.
1 parent 8dbc369 commit d50fa7e

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,25 @@ for types as needed by the compiler, and it is currently disallowed to
684684
explicitly implement it for a type.
685685
"##,
686686

687+
E0326: r##"
688+
The types of any associated constants in a trait implementation must match the
689+
types in the trait definition. This error indicates that there was a mismatch.
690+
691+
Here's an example of this error:
692+
693+
```
694+
trait Foo {
695+
const BAR: bool;
696+
}
697+
698+
struct Bar;
699+
700+
impl Foo for Bar {
701+
const BAR: u32 = 5; // error, expected bool, found u32
702+
}
703+
```
704+
"##,
705+
687706
E0368: r##"
688707
This error indicates that a binary assignment operator like `+=` or `^=` was
689708
applied to the wrong types.
@@ -885,7 +904,6 @@ register_diagnostics! {
885904
E0323, // implemented an associated const when another trait item expected
886905
E0324, // implemented a method when another trait item expected
887906
E0325, // implemented an associated type when another trait item expected
888-
E0326, // associated const implemented with different type from trait
889907
E0327, // referred to method instead of constant in match pattern
890908
E0328, // cannot implement Unsize explicitly
891909
E0366, // dropck forbid specialization to concrete type or region

0 commit comments

Comments
 (0)