Skip to content

Commit 1d772f6

Browse files
---
yaml --- r: 232767 b: refs/heads/try c: 9e51cee h: refs/heads/master i: 232765: 86f2985 232763: 3a1a049 232759: 097901a 232751: aaca804 232735: 8eec260 232703: c4f3915 v: v3
1 parent 500e441 commit 1d772f6

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: dddc4ca90b406e24e890bfdb1566cb8ea93c9c48
4+
refs/heads/try: 9e51cee69a24704facbdf0a9b0a8e4fe5f9c85ac
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc_typeck/diagnostics.rs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,32 @@ variadic functions (except for its C-FFI).
640640

641641
E0062: r##"
642642
This error indicates that during an attempt to build a struct or struct-like
643-
enum variant, one of the fields was specified more than once. Each field should
644-
be specified exactly one time.
643+
enum variant, one of the fields was specified more than once. Erroneous code
644+
example:
645+
646+
```
647+
struct Foo {
648+
x: i32
649+
}
650+
651+
fn main() {
652+
let x = Foo { x: 0,
653+
x: 0, // error: field `x` specified more than once
654+
};
655+
}
656+
```
657+
658+
Each field should be specified exactly one time. Example:
659+
660+
```
661+
struct Foo {
662+
x: i32
663+
}
664+
665+
fn main() {
666+
let x = Foo { x: 0 }; // ok!
667+
}
668+
```
645669
"##,
646670

647671
E0063: r##"

0 commit comments

Comments
 (0)