@@ -23,40 +23,58 @@ LL | struct TupleStruct<S, T>(S, T);
23
23
LL | TupleStruct(a, a, b) = TupleStruct(1, 2);
24
24
| ^^^^^^^^^^^^^^^^^^^^ expected 2 fields, found 3
25
25
26
- error[E0023]: this pattern has 3 fields , but the corresponding tuple variant has 2 fields
26
+ error[E0023]: this pattern has 1 field , but the corresponding tuple struct has 2 fields
27
27
--> $DIR/tuple_struct_destructure_fail.rs:32:5
28
28
|
29
+ LL | struct TupleStruct<S, T>(S, T);
30
+ | ------------------------------- tuple struct defined here
31
+ ...
32
+ LL | TupleStruct(_) = TupleStruct(1, 2);
33
+ | ^^^^^^^^^^^^^^ expected 2 fields, found 1
34
+
35
+ error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
36
+ --> $DIR/tuple_struct_destructure_fail.rs:34:5
37
+ |
29
38
LL | SingleVariant(S, T)
30
39
| ------------------- tuple variant defined here
31
40
...
32
41
LL | Enum::SingleVariant(a, a, b) = Enum::SingleVariant(1, 2);
33
42
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 2 fields, found 3
34
43
44
+ error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
45
+ --> $DIR/tuple_struct_destructure_fail.rs:36:5
46
+ |
47
+ LL | SingleVariant(S, T)
48
+ | ------------------- tuple variant defined here
49
+ ...
50
+ LL | Enum::SingleVariant(_) = Enum::SingleVariant(1, 2);
51
+ | ^^^^^^^^^^^^^^^^^^^^^^ expected 2 fields, found 1
52
+
35
53
error[E0070]: invalid left-hand side of assignment
36
- --> $DIR/tuple_struct_destructure_fail.rs:36 :12
54
+ --> $DIR/tuple_struct_destructure_fail.rs:40 :12
37
55
|
38
56
LL | test() = TupleStruct(0, 0);
39
57
| ------ ^
40
58
| |
41
59
| cannot assign to this expression
42
60
43
61
error[E0070]: invalid left-hand side of assignment
44
- --> $DIR/tuple_struct_destructure_fail.rs:38 :14
62
+ --> $DIR/tuple_struct_destructure_fail.rs:42 :14
45
63
|
46
64
LL | (test)() = TupleStruct(0, 0);
47
65
| -------- ^
48
66
| |
49
67
| cannot assign to this expression
50
68
51
69
error[E0070]: invalid left-hand side of assignment
52
- --> $DIR/tuple_struct_destructure_fail.rs:40 :38
70
+ --> $DIR/tuple_struct_destructure_fail.rs:44 :38
53
71
|
54
72
LL | <Alias::<isize> as Test>::test() = TupleStruct(0, 0);
55
73
| -------------------------------- ^
56
74
| |
57
75
| cannot assign to this expression
58
76
59
- error: aborting due to 7 previous errors
77
+ error: aborting due to 9 previous errors
60
78
61
79
Some errors have detailed explanations: E0023, E0070.
62
80
For more information about an error, try `rustc --explain E0023`.
0 commit comments