about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-05-22 21:44:54 +0200
committerGitHub <noreply@github.com>2020-05-22 21:44:54 +0200
commit47f3c440eceb0a82b8d516176da5da515dde02b9 (patch)
tree549237ce4ee71d6882d9c029218392f5072a55f0 /src/librustc_error_codes/error_codes
parentdd78839432e0ad3ab1d80bd5007d47358b76bfc3 (diff)
parente9ae64cca7fd5f88b8c94dbb464594ca13f26792 (diff)
downloadrust-47f3c440eceb0a82b8d516176da5da515dde02b9.tar.gz
rust-47f3c440eceb0a82b8d516176da5da515dde02b9.zip
Rollup merge of #72375 - GuillaumeGomez:cleanup-e0599, r=Dylan-DPC
Improve E0599 explanation

r? @Dylan-DPC
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0599.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/librustc_error_codes/error_codes/E0599.md b/src/librustc_error_codes/error_codes/E0599.md
index c44e60571e1..5b1590b2999 100644
--- a/src/librustc_error_codes/error_codes/E0599.md
+++ b/src/librustc_error_codes/error_codes/E0599.md
@@ -9,3 +9,18 @@ let x = Mouth;
 x.chocolate(); // error: no method named `chocolate` found for type `Mouth`
                //        in the current scope
 ```
+
+In this case, you need to implement the `chocolate` method to fix the error:
+
+```
+struct Mouth;
+
+impl Mouth {
+    fn chocolate(&self) { // We implement the `chocolate` method here.
+        println!("Hmmm! I love chocolate!");
+    }
+}
+
+let x = Mouth;
+x.chocolate(); // ok!
+```