Skip to content

Commit

Permalink
Improve E0062 error explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 26, 2015
1 parent dddc4ca commit 9e51cee
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/librustc_typeck/diagnostics.rs
Expand Up @@ -640,8 +640,32 @@ variadic functions (except for its C-FFI).

E0062: r##"
This error indicates that during an attempt to build a struct or struct-like
enum variant, one of the fields was specified more than once. Each field should
be specified exactly one time.
enum variant, one of the fields was specified more than once. Erroneous code
example:
```
struct Foo {
x: i32
}
fn main() {
let x = Foo { x: 0,
x: 0, // error: field `x` specified more than once
};
}
```
Each field should be specified exactly one time. Example:
```
struct Foo {
x: i32
}
fn main() {
let x = Foo { x: 0 }; // ok!
}
```
"##,

E0063: r##"
Expand Down

0 comments on commit 9e51cee

Please sign in to comment.