about summary refs log tree commit diff
diff options
context:
space:
mode:
authorggomez <guillaume1.gomez@gmail.com>2016-07-21 16:18:12 +0200
committerAriel Ben-Yehuda <ariel.byd@gmail.com>2016-07-22 22:47:38 +0300
commit0304850942d40c798750c4a1ba194c3992dbde1a (patch)
tree694a99a414309693979c57ce40cddfe90aa4741c
parente76a46a10d9bc0e5a2765addf24c3069555bdc83 (diff)
downloadrust-0304850942d40c798750c4a1ba194c3992dbde1a.tar.gz
rust-0304850942d40c798750c4a1ba194c3992dbde1a.zip
Add E0560 error explanation
-rw-r--r--src/librustc_typeck/diagnostics.rs27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index 6000ea71bff..e7efed905ad 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -3980,6 +3980,32 @@ impl SpaceLlama for i32 {
 ```
 "##,
 
+E0560: r##"
+An unknown field was specified into a structure.
+
+Erroneous code example:
+
+```compile_fail,E0560
+struct Simba {
+    mother: u32,
+}
+
+let s = Simba { mother: 1, father: 0 };
+// error: structure `Simba` has no field named `father`
+```
+
+Verify you didn't misspell the field's name or that the field exists. Example:
+
+```
+struct Simba {
+    mother: u32,
+    father: u32,
+}
+
+let s = Simba { mother: 1, father: 0 }; // ok!
+```
+"##,
+
 }
 
 register_diagnostics! {
@@ -4054,5 +4080,4 @@ register_diagnostics! {
     E0529, // slice pattern expects array or slice, not `{}`
     E0533, // `{}` does not name a unit variant, unit struct or a constant
     E0559,
-    E0560,
 }