File tree Expand file tree Collapse file tree 2 files changed +34
-5
lines changed
branches/try/src/librustc_typeck Expand file tree Collapse file tree 2 files changed +34
-5
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
3
3
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4
- refs/heads/try: 612221ff8035b21a343c73921334071346609eb9
4
+ refs/heads/try: 5d8dc9076bf387398eeac9c50109a15026e22b36
5
5
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
6
6
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
7
7
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -73,10 +73,39 @@ the enum.
73
73
"## ,
74
74
75
75
E0025 : r##"
76
- Each field of a struct can only be bound once in a pattern. Each occurrence of a
77
- field name binds the value of that field, so to fix this error you will have to
78
- remove or alter the duplicate uses of the field name. Perhaps you misspelt
79
- another field name?
76
+ Each field of a struct can only be bound once in a pattern. Erroneous code
77
+ example:
78
+
79
+ ```
80
+ struct Foo {
81
+ a: u8,
82
+ b: u8,
83
+ }
84
+
85
+ fn main(){
86
+ let x = Foo { a:1, b:2 };
87
+
88
+ let Foo { a: x, a: y } = x;
89
+ // error: field `a` bound multiple times in the pattern
90
+ }
91
+ ```
92
+
93
+ Each occurrence of a field name binds the value of that field, so to fix this
94
+ error you will have to remove or alter the duplicate uses of the field name.
95
+ Perhaps you misspelled another field name? Example:
96
+
97
+ ```
98
+ struct Foo {
99
+ a: u8,
100
+ b: u8,
101
+ }
102
+
103
+ fn main(){
104
+ let x = Foo { a:1, b:2 };
105
+
106
+ let Foo { a: x, b: y } = x; // ok!
107
+ }
108
+ ```
80
109
"## ,
81
110
82
111
E0026 : r##"
You can’t perform that action at this time.
0 commit comments