]> git.lizzy.rs Git - rust.git/commitdiff
Add E0560 error explanation
authorggomez <guillaume1.gomez@gmail.com>
Thu, 21 Jul 2016 14:18:12 +0000 (16:18 +0200)
committerAriel Ben-Yehuda <ariel.byd@gmail.com>
Fri, 22 Jul 2016 19:47:38 +0000 (22:47 +0300)
src/librustc_typeck/diagnostics.rs

index 6000ea71bff8ec9ec2f9e5b3af5289bca6e91872..e7efed905ad7b629186849f2d07f15c18ad3d928 100644 (file)
@@ -3980,6 +3980,32 @@ fn fly(&self) {} // And now that's ok!
 ```
 "##,
 
+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 @@ fn fly(&self) {} // And now that's ok!
     E0529, // slice pattern expects array or slice, not `{}`
     E0533, // `{}` does not name a unit variant, unit struct or a constant
     E0559,
-    E0560,
 }