]> git.lizzy.rs Git - rust.git/commitdiff
Add E0559 error explanation
authorggomez <guillaume1.gomez@gmail.com>
Thu, 21 Jul 2016 14:47:05 +0000 (16:47 +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 e7efed905ad7b629186849f2d07f15c18ad3d928..500f624ea3f72f870eece3b65108997dfc74f6f7 100644 (file)
@@ -3980,6 +3980,31 @@ fn fly(&self) {} // And now that's ok!
 ```
 "##,
 
+E0559: r##"
+An unknown field was specified into an enum's structure variant.
+
+Erroneous code example:
+
+```compile_fail,E0559
+enum Field {
+    Fool { x: u32 },
+}
+
+let s = Field::Fool { joke: 0 };
+// error: struct variant `Field::Fool` has no field named `joke`
+```
+
+Verify you didn't misspell the field's name or that the field exists. Example:
+
+```
+enum Field {
+    Fool { joke: u32 },
+}
+
+let s = Field::Fool { joke: 0 }; // ok!
+```
+"##,
+
 E0560: r##"
 An unknown field was specified into a structure.
 
@@ -4079,5 +4104,4 @@ struct Simba {
     E0528, // expected at least {} elements, found {}
     E0529, // slice pattern expects array or slice, not `{}`
     E0533, // `{}` does not name a unit variant, unit struct or a constant
-    E0559,
 }