about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-05-20 12:02:52 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-05-20 12:03:24 +0200
commite9ae64cca7fd5f88b8c94dbb464594ca13f26792 (patch)
tree04d84f49e18148aff4a93ec5f566d4c8e319b45c /src/librustc_error_codes/error_codes
parent97f3eeec8216d7155c24674b9be55e7c672bcae3 (diff)
downloadrust-e9ae64cca7fd5f88b8c94dbb464594ca13f26792.tar.gz
rust-e9ae64cca7fd5f88b8c94dbb464594ca13f26792.zip
Improve E0599 explanation
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!
+```