2021-08-18 18:13:25 -05:00
|
|
|
error[E0530]: match bindings cannot shadow tuple structs
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:57:9
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | struct Z1();
|
|
|
|
| ------------ the tuple struct `Z1` is defined here
|
|
|
|
...
|
|
|
|
LL | Z1 => {}
|
2022-07-08 06:54:11 -05:00
|
|
|
| ^^
|
|
|
|
| |
|
|
|
|
| cannot be named the same as a tuple struct
|
|
|
|
| help: try specify the pattern arguments: `Z1(..)`
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:52:9
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | struct Z0;
|
|
|
|
| ---------- `Z0` defined here
|
|
|
|
LL | struct Z1();
|
|
|
|
| ------------ similarly named tuple struct `Z1` defined here
|
|
|
|
...
|
|
|
|
LL | Z0() => {}
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
|
help: use this syntax instead
|
|
|
|
|
|
|
|
|
LL | Z0 => {}
|
|
|
|
| ~~
|
|
|
|
help: a tuple struct with a similar name exists
|
|
|
|
|
|
|
|
|
LL | Z1() => {}
|
|
|
|
| ~~
|
|
|
|
|
|
|
|
error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:53:9
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | struct Z0;
|
|
|
|
| ---------- `Z0` defined here
|
|
|
|
LL | struct Z1();
|
|
|
|
| ------------ similarly named tuple struct `Z1` defined here
|
|
|
|
...
|
|
|
|
LL | Z0(_) => {}
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
help: use this syntax instead
|
|
|
|
|
|
|
|
|
LL | Z0 => {}
|
|
|
|
| ~~
|
|
|
|
help: a tuple struct with a similar name exists
|
|
|
|
|
|
|
|
|
LL | Z1(_) => {}
|
|
|
|
| ~~
|
|
|
|
|
|
|
|
error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:54:9
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | struct Z0;
|
|
|
|
| ---------- `Z0` defined here
|
|
|
|
LL | struct Z1();
|
|
|
|
| ------------ similarly named tuple struct `Z1` defined here
|
|
|
|
...
|
|
|
|
LL | Z0(_, _) => {}
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
help: use this syntax instead
|
|
|
|
|
|
|
|
|
LL | Z0 => {}
|
|
|
|
| ~~
|
|
|
|
help: a tuple struct with a similar name exists
|
|
|
|
|
|
|
|
|
LL | Z1(_, _) => {}
|
|
|
|
| ~~
|
|
|
|
|
|
|
|
error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0`
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:64:9
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | Z0,
|
|
|
|
| -- `E1::Z0` defined here
|
|
|
|
LL | Z1(),
|
|
|
|
| ---- similarly named tuple variant `Z1` defined here
|
|
|
|
...
|
|
|
|
LL | E1::Z0() => {}
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
help: use this syntax instead
|
|
|
|
|
|
|
|
|
LL | E1::Z0 => {}
|
|
|
|
| ~~~~~~
|
|
|
|
help: a tuple variant with a similar name exists
|
|
|
|
|
|
|
|
|
LL | E1::Z1() => {}
|
|
|
|
| ~~
|
|
|
|
|
|
|
|
error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0`
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:65:9
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | Z0,
|
|
|
|
| -- `E1::Z0` defined here
|
|
|
|
LL | Z1(),
|
|
|
|
| ---- similarly named tuple variant `Z1` defined here
|
|
|
|
...
|
|
|
|
LL | E1::Z0(_) => {}
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: use this syntax instead
|
|
|
|
|
|
|
|
|
LL | E1::Z0 => {}
|
|
|
|
| ~~~~~~
|
|
|
|
help: a tuple variant with a similar name exists
|
|
|
|
|
|
|
|
|
LL | E1::Z1(_) => {}
|
|
|
|
| ~~
|
|
|
|
|
|
|
|
error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0`
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:66:9
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | Z0,
|
|
|
|
| -- `E1::Z0` defined here
|
|
|
|
LL | Z1(),
|
|
|
|
| ---- similarly named tuple variant `Z1` defined here
|
|
|
|
...
|
|
|
|
LL | E1::Z0(_, _) => {}
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: use this syntax instead
|
|
|
|
|
|
|
|
|
LL | E1::Z0 => {}
|
|
|
|
| ~~~~~~
|
|
|
|
help: a tuple variant with a similar name exists
|
|
|
|
|
|
|
|
|
LL | E1::Z1(_, _) => {}
|
|
|
|
| ~~
|
|
|
|
|
|
|
|
error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E1::Z1`
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:69:9
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | Z0,
|
|
|
|
| -- similarly named unit variant `Z0` defined here
|
|
|
|
LL | Z1(),
|
|
|
|
| ---- `E1::Z1` defined here
|
|
|
|
...
|
|
|
|
LL | E1::Z1 => {}
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
help: use the tuple variant pattern syntax instead
|
|
|
|
|
|
|
|
|
LL | E1::Z1() => {}
|
|
|
|
| ~~~~~~~~
|
|
|
|
help: a unit variant with a similar name exists
|
|
|
|
|
|
|
|
|
LL | E1::Z0 => {}
|
|
|
|
| ~~
|
|
|
|
|
2018-08-08 07:28:26 -05:00
|
|
|
error[E0308]: mismatched types
|
2021-08-21 20:41:34 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:19:9
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2021-12-15 17:16:21 -06:00
|
|
|
LL | match (1, 2, 3) {
|
|
|
|
| --------- this expression has type `({integer}, {integer}, {integer})`
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | (1, 2, 3, 4) => {}
|
2018-08-08 07:28:26 -05:00
|
|
|
| ^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements
|
|
|
|
|
|
2019-11-13 16:16:56 -06:00
|
|
|
= note: expected tuple `({integer}, {integer}, {integer})`
|
|
|
|
found tuple `(_, _, _, _)`
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2021-08-21 20:41:34 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:20:9
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2021-12-15 17:16:21 -06:00
|
|
|
LL | match (1, 2, 3) {
|
|
|
|
| --------- this expression has type `({integer}, {integer}, {integer})`
|
|
|
|
LL | (1, 2, 3, 4) => {}
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | (1, 2, .., 3, 4) => {}
|
2018-08-08 07:28:26 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements
|
|
|
|
|
|
2019-11-13 16:16:56 -06:00
|
|
|
= note: expected tuple `({integer}, {integer}, {integer})`
|
|
|
|
found tuple `(_, _, _, _)`
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
|
2021-08-21 20:41:34 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:24:11
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-09-04 21:04:26 -05:00
|
|
|
LL | struct S(u8, u8, u8);
|
2021-08-18 18:13:52 -05:00
|
|
|
| -- -- -- tuple struct has 3 fields
|
2019-09-04 21:04:26 -05:00
|
|
|
...
|
2018-08-08 07:28:26 -05:00
|
|
|
LL | S(1, 2, 3, 4) => {}
|
2021-08-25 16:40:06 -05:00
|
|
|
| ^ ^ ^ ^ expected 3 fields, found 4
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
|
2021-08-21 20:41:34 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:26:11
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2019-09-04 21:04:26 -05:00
|
|
|
LL | struct S(u8, u8, u8);
|
2021-08-18 18:13:52 -05:00
|
|
|
| -- -- -- tuple struct has 3 fields
|
2019-09-04 21:04:26 -05:00
|
|
|
...
|
2018-08-08 07:28:26 -05:00
|
|
|
LL | S(1, 2, .., 3, 4) => {}
|
2021-08-25 16:40:06 -05:00
|
|
|
| ^ ^ ^ ^ expected 3 fields, found 4
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2021-08-18 18:13:25 -05:00
|
|
|
error[E0023]: this pattern has 6 fields, but the corresponding tuple struct has 5 fields
|
2021-08-21 20:41:34 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:31:11
|
2021-08-18 18:13:52 -05:00
|
|
|
|
|
|
|
|
LL | struct M(
|
|
|
|
| - tuple struct defined here
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| -- tuple struct has 5 fields
|
2021-08-18 18:13:25 -05:00
|
|
|
...
|
2021-08-18 18:13:52 -05:00
|
|
|
LL | M(1, 2, 3, 4, 5, 6) => {}
|
2021-08-25 16:40:06 -05:00
|
|
|
| ^ ^ ^ ^ ^ ^ expected 5 fields, found 6
|
|
|
|
|
|
|
|
error[E0023]: this pattern has 6 fields, but the corresponding tuple struct has 5 fields
|
|
|
|
--> $DIR/pat-tuple-overfield.rs:33:11
|
|
|
|
|
|
|
|
|
LL | struct M(
|
|
|
|
| - tuple struct defined here
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| -- tuple struct has 5 fields
|
|
|
|
...
|
|
|
|
LL | M(1,
|
|
|
|
| - ^
|
|
|
|
LL | 2,
|
|
|
|
| ^
|
|
|
|
LL | 3,
|
|
|
|
| ^
|
|
|
|
LL | 4,
|
|
|
|
| ^
|
|
|
|
LL | 5,
|
|
|
|
| ^
|
|
|
|
LL | 6) => {}
|
|
|
|
| ^ expected 5 fields, found 6
|
|
|
|
|
|
|
|
error[E0023]: this pattern has 6 fields, but the corresponding tuple struct has 5 fields
|
|
|
|
--> $DIR/pat-tuple-overfield.rs:41:13
|
|
|
|
|
|
|
|
|
LL | struct M(
|
|
|
|
| - tuple struct defined here
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| --
|
|
|
|
LL | u8,
|
|
|
|
| -- tuple struct has 5 fields
|
|
|
|
...
|
|
|
|
LL | M(
|
|
|
|
| -
|
|
|
|
LL | 1,
|
|
|
|
| ^
|
|
|
|
LL | 2,
|
|
|
|
| ^
|
|
|
|
LL | 3,
|
|
|
|
| ^
|
|
|
|
LL | 4,
|
|
|
|
| ^
|
|
|
|
LL | 5,
|
|
|
|
| ^
|
|
|
|
LL | 6,
|
|
|
|
| ^ expected 5 fields, found 6
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 0 fields
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:59:12
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | struct Z1();
|
2022-02-13 09:27:59 -06:00
|
|
|
| --------- tuple struct has 0 fields
|
2021-08-18 18:13:25 -05:00
|
|
|
...
|
|
|
|
LL | Z1(_) => {}
|
2021-08-25 16:40:06 -05:00
|
|
|
| ^ expected 0 fields, found 1
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 0 fields
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:60:12
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | struct Z1();
|
2022-02-13 09:27:59 -06:00
|
|
|
| --------- tuple struct has 0 fields
|
2021-08-18 18:13:25 -05:00
|
|
|
...
|
|
|
|
LL | Z1(_, _) => {}
|
2021-08-25 16:40:06 -05:00
|
|
|
| ^ ^ expected 0 fields, found 2
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 0 fields
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:71:16
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | Z1(),
|
2022-07-04 04:13:16 -05:00
|
|
|
| -- tuple variant has 0 fields
|
2021-08-18 18:13:25 -05:00
|
|
|
...
|
|
|
|
LL | E1::Z1(_) => {}
|
2021-08-25 16:40:06 -05:00
|
|
|
| ^ expected 0 fields, found 1
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 0 fields
|
2021-08-25 16:40:06 -05:00
|
|
|
--> $DIR/pat-tuple-overfield.rs:72:16
|
2021-08-18 18:13:25 -05:00
|
|
|
|
|
|
|
|
LL | Z1(),
|
2022-07-04 04:13:16 -05:00
|
|
|
| -- tuple variant has 0 fields
|
2021-08-18 18:13:25 -05:00
|
|
|
...
|
|
|
|
LL | E1::Z1(_, _) => {}
|
2021-08-25 16:40:06 -05:00
|
|
|
| ^ ^ expected 0 fields, found 2
|
2021-08-18 18:13:25 -05:00
|
|
|
|
2021-08-25 16:40:06 -05:00
|
|
|
error: aborting due to 19 previous errors
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2021-08-18 18:13:25 -05:00
|
|
|
Some errors have detailed explanations: E0023, E0308, E0530, E0532.
|
2018-08-08 07:28:26 -05:00
|
|
|
For more information about an error, try `rustc --explain E0023`.
|