From c3303c7b086fef4d2571869fe6040ca9455c6e38 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 21 Feb 2020 13:31:21 +0100 Subject: [PATCH 1/2] Clean up E0323, E0324 and E0325 explanations --- src/librustc_error_codes/error_codes/E0323.md | 1 + src/librustc_error_codes/error_codes/E0324.md | 5 +++-- src/librustc_error_codes/error_codes/E0325.md | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0323.md b/src/librustc_error_codes/error_codes/E0323.md index 6d34c35f9cbb6..0bf42d17ebcf4 100644 --- a/src/librustc_error_codes/error_codes/E0323.md +++ b/src/librustc_error_codes/error_codes/E0323.md @@ -1,4 +1,5 @@ An associated const was implemented when another trait item was expected. + Erroneous code example: ```compile_fail,E0323 diff --git a/src/librustc_error_codes/error_codes/E0324.md b/src/librustc_error_codes/error_codes/E0324.md index b8c9e596990c1..1442cb77dd977 100644 --- a/src/librustc_error_codes/error_codes/E0324.md +++ b/src/librustc_error_codes/error_codes/E0324.md @@ -1,5 +1,6 @@ -A method was implemented when another trait item was expected. Erroneous -code example: +A method was implemented when another trait item was expected. + +Erroneous code example: ```compile_fail,E0324 struct Bar; diff --git a/src/librustc_error_codes/error_codes/E0325.md b/src/librustc_error_codes/error_codes/E0325.md index f685b92cbf064..656fd1ec82b56 100644 --- a/src/librustc_error_codes/error_codes/E0325.md +++ b/src/librustc_error_codes/error_codes/E0325.md @@ -1,4 +1,5 @@ An associated type was implemented when another trait item was expected. + Erroneous code example: ```compile_fail,E0325 From 8f3fcec351fcc24aba462f200c60dd712592b64d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 21 Feb 2020 13:32:04 +0100 Subject: [PATCH 2/2] Clean up E0326 explanation --- src/librustc_error_codes/error_codes/E0326.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0326.md b/src/librustc_error_codes/error_codes/E0326.md index 0702d00c2de55..3d357819c7f91 100644 --- a/src/librustc_error_codes/error_codes/E0326.md +++ b/src/librustc_error_codes/error_codes/E0326.md @@ -1,7 +1,6 @@ -The types of any associated constants in a trait implementation must match the -types in the trait definition. This error indicates that there was a mismatch. +An implementation of a trait doesn't match the type contraint. -Here's an example of this error: +Erroneous code example: ```compile_fail,E0326 trait Foo { @@ -14,3 +13,6 @@ 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.