2020-11-07 14:28:55 +00:00
|
|
|
error: `..` can only be used once per tuple struct or variant pattern
|
|
|
|
--> $DIR/tuple_struct_destructure_fail.rs:25:27
|
|
|
|
|
|
|
|
|
LL | TupleStruct(a, .., b, ..) = TupleStruct(0, 1);
|
|
|
|
| -- ^^ can only be used once per tuple struct or variant pattern
|
|
|
|
| |
|
|
|
|
| previously used here
|
|
|
|
|
|
|
|
error: `..` can only be used once per tuple struct or variant pattern
|
|
|
|
--> $DIR/tuple_struct_destructure_fail.rs:27:35
|
|
|
|
|
|
|
|
|
LL | Enum::SingleVariant(a, .., b, ..) = Enum::SingleVariant(0, 1);
|
|
|
|
| -- ^^ can only be used once per tuple struct or variant pattern
|
|
|
|
| |
|
|
|
|
| previously used here
|
|
|
|
|
|
|
|
error[E0023]: this pattern has 3 fields, but the corresponding tuple struct has 2 fields
|
2021-08-17 13:55:31 -07:00
|
|
|
--> $DIR/tuple_struct_destructure_fail.rs:30:16
|
2020-11-07 14:28:55 +00:00
|
|
|
|
|
|
|
|
LL | struct TupleStruct<S, T>(S, T);
|
|
|
|
| ------------------------------- tuple struct defined here
|
|
|
|
...
|
|
|
|
LL | TupleStruct(a, a, b) = TupleStruct(1, 2);
|
2021-08-17 13:55:31 -07:00
|
|
|
| -----------^^^^^^^^^ expected 2 fields, found 3
|
|
|
|
| |
|
|
|
|
| this tuple struct
|
2020-11-07 14:28:55 +00:00
|
|
|
|
2020-11-11 13:15:15 +00:00
|
|
|
error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields
|
2021-08-17 13:55:31 -07:00
|
|
|
--> $DIR/tuple_struct_destructure_fail.rs:32:16
|
2020-11-07 14:28:55 +00:00
|
|
|
|
|
2020-11-11 13:15:15 +00:00
|
|
|
LL | struct TupleStruct<S, T>(S, T);
|
|
|
|
| ------------------------------- tuple struct defined here
|
|
|
|
...
|
|
|
|
LL | TupleStruct(_) = TupleStruct(1, 2);
|
2021-08-17 13:55:31 -07:00
|
|
|
| -----------^^^ expected 2 fields, found 1
|
|
|
|
| |
|
|
|
|
| this tuple struct
|
2021-01-12 19:06:20 -08:00
|
|
|
|
|
|
|
|
help: use `_` to explicitly ignore each field
|
|
|
|
|
|
|
|
|
LL | TupleStruct(_, _) = TupleStruct(1, 2);
|
2021-06-21 19:07:19 -07:00
|
|
|
| +++
|
2021-01-12 20:39:51 -08:00
|
|
|
help: use `..` to ignore all fields
|
|
|
|
|
|
|
|
|
LL | TupleStruct(..) = TupleStruct(1, 2);
|
2021-06-21 19:07:19 -07:00
|
|
|
| ~~
|
2020-11-11 13:15:15 +00:00
|
|
|
|
|
|
|
error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
|
2021-08-17 13:55:31 -07:00
|
|
|
--> $DIR/tuple_struct_destructure_fail.rs:34:24
|
2020-11-11 13:15:15 +00:00
|
|
|
|
|
2020-11-07 14:28:55 +00:00
|
|
|
LL | SingleVariant(S, T)
|
|
|
|
| ------------------- tuple variant defined here
|
|
|
|
...
|
|
|
|
LL | Enum::SingleVariant(a, a, b) = Enum::SingleVariant(1, 2);
|
2021-08-17 13:55:31 -07:00
|
|
|
| -------------------^^^^^^^^^ expected 2 fields, found 3
|
|
|
|
| |
|
|
|
|
| this tuple variant
|
2020-11-07 14:28:55 +00:00
|
|
|
|
2020-11-11 13:15:15 +00:00
|
|
|
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
|
2021-08-17 13:55:31 -07:00
|
|
|
--> $DIR/tuple_struct_destructure_fail.rs:36:24
|
2020-11-11 13:15:15 +00:00
|
|
|
|
|
|
|
|
LL | SingleVariant(S, T)
|
|
|
|
| ------------------- tuple variant defined here
|
|
|
|
...
|
|
|
|
LL | Enum::SingleVariant(_) = Enum::SingleVariant(1, 2);
|
2021-08-17 13:55:31 -07:00
|
|
|
| -------------------^^^ expected 2 fields, found 1
|
|
|
|
| |
|
|
|
|
| this tuple variant
|
2021-01-12 19:06:20 -08:00
|
|
|
|
|
|
|
|
help: use `_` to explicitly ignore each field
|
|
|
|
|
|
|
|
|
LL | Enum::SingleVariant(_, _) = Enum::SingleVariant(1, 2);
|
2021-06-21 19:07:19 -07:00
|
|
|
| +++
|
2021-01-12 20:39:51 -08:00
|
|
|
help: use `..` to ignore all fields
|
|
|
|
|
|
|
|
|
LL | Enum::SingleVariant(..) = Enum::SingleVariant(1, 2);
|
2021-06-21 19:07:19 -07:00
|
|
|
| ~~
|
2020-11-11 13:15:15 +00:00
|
|
|
|
2020-11-07 14:28:55 +00:00
|
|
|
error[E0070]: invalid left-hand side of assignment
|
2020-11-11 13:15:15 +00:00
|
|
|
--> $DIR/tuple_struct_destructure_fail.rs:40:12
|
2020-11-07 14:28:55 +00:00
|
|
|
|
|
|
|
|
LL | test() = TupleStruct(0, 0);
|
|
|
|
| ------ ^
|
|
|
|
| |
|
|
|
|
| cannot assign to this expression
|
|
|
|
|
|
|
|
error[E0070]: invalid left-hand side of assignment
|
2020-11-11 13:15:15 +00:00
|
|
|
--> $DIR/tuple_struct_destructure_fail.rs:42:14
|
2020-11-07 14:28:55 +00:00
|
|
|
|
|
|
|
|
LL | (test)() = TupleStruct(0, 0);
|
|
|
|
| -------- ^
|
|
|
|
| |
|
|
|
|
| cannot assign to this expression
|
|
|
|
|
|
|
|
error[E0070]: invalid left-hand side of assignment
|
2020-11-11 13:15:15 +00:00
|
|
|
--> $DIR/tuple_struct_destructure_fail.rs:44:38
|
2020-11-07 14:28:55 +00:00
|
|
|
|
|
|
|
|
LL | <Alias::<isize> as Test>::test() = TupleStruct(0, 0);
|
|
|
|
| -------------------------------- ^
|
|
|
|
| |
|
|
|
|
| cannot assign to this expression
|
|
|
|
|
2020-11-11 13:15:15 +00:00
|
|
|
error: aborting due to 9 previous errors
|
2020-11-07 14:28:55 +00:00
|
|
|
|
|
|
|
Some errors have detailed explanations: E0023, E0070.
|
|
|
|
For more information about an error, try `rustc --explain E0023`.
|