diff options
Diffstat (limited to '')
-rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0326.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0326.md b/compiler/rustc_error_codes/src/error_codes/E0326.md new file mode 100644 index 000000000..bc522e9cf --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0326.md @@ -0,0 +1,18 @@ +An implementation of a trait doesn't match the type constraint. + +Erroneous code example: + +```compile_fail,E0326 +trait Foo { + const BAR: bool; +} + +struct Bar; + +impl Foo for Bar { + const BAR: u32 = 5; // error, expected bool, found u32 +} +``` + +The types of any associated constants in a trait implementation must match the +types in the trait definition. |