diff options
| author | ggomez <guillaume1.gomez@gmail.com> | 2016-07-21 16:47:05 +0200 |
|---|---|---|
| committer | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2016-07-22 22:47:38 +0300 |
| commit | 23bb1df1e52dd17062cd135b5be70ba55d5af147 (patch) | |
| tree | 77e486f00d90d1f978816a09313c3d55d6ef9704 /src | |
| parent | 0304850942d40c798750c4a1ba194c3992dbde1a (diff) | |
| download | rust-23bb1df1e52dd17062cd135b5be70ba55d5af147.tar.gz rust-23bb1df1e52dd17062cd135b5be70ba55d5af147.zip | |
Add E0559 error explanation
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/diagnostics.rs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index e7efed905ad..500f624ea3f 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -3980,6 +3980,31 @@ impl SpaceLlama for i32 { ``` "##, +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 @@ register_diagnostics! { 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, } |
