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