summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0437.md
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0437.md')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0437.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0437.md b/compiler/rustc_error_codes/src/error_codes/E0437.md
new file mode 100644
index 000000000..0f924ba69
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0437.md
@@ -0,0 +1,23 @@
+An associated type whose name does not match any of the associated types
+in the trait was used when implementing the trait.
+
+Erroneous code example:
+
+```compile_fail,E0437
+trait Foo {}
+
+impl Foo for i32 {
+ type Bar = bool;
+}
+```
+
+Trait implementations can only implement associated types that are members of
+the trait in question.
+
+The solution to this problem is to remove the extraneous associated type:
+
+```
+trait Foo {}
+
+impl Foo for i32 {}
+```