2020-12-13 16:13:52 -06:00
|
|
|
error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E::S`
|
2021-01-12 22:39:51 -06:00
|
|
|
--> $DIR/pat-tuple-underfield.rs:44:9
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
|
LL | S(i32, f32),
|
|
|
|
| ----------- `E::S` defined here
|
|
|
|
...
|
|
|
|
LL | E::S => {}
|
|
|
|
| ^^^^ help: use the tuple variant pattern syntax instead: `E::S(_, _)`
|
|
|
|
|
|
|
|
error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields
|
2021-01-12 18:47:04 -06:00
|
|
|
--> $DIR/pat-tuple-underfield.rs:9:9
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
|
LL | struct S(i32, f32);
|
|
|
|
| ------------------- tuple struct defined here
|
|
|
|
...
|
|
|
|
LL | S(x) => {}
|
2021-01-12 21:06:20 -06:00
|
|
|
| ^^^^ expected 2 fields, found 1
|
|
|
|
|
|
|
|
|
help: use `_` to explicitly ignore each field
|
|
|
|
|
|
|
|
|
LL | S(x, _) => {}
|
|
|
|
| ^^^
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields
|
2021-01-12 18:47:04 -06:00
|
|
|
--> $DIR/pat-tuple-underfield.rs:14:9
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
|
LL | struct S(i32, f32);
|
|
|
|
| ------------------- tuple struct defined here
|
|
|
|
...
|
|
|
|
LL | S(_) => {}
|
2021-01-12 21:06:20 -06:00
|
|
|
| ^^^^ expected 2 fields, found 1
|
|
|
|
|
|
|
|
|
help: use `_` to explicitly ignore each field
|
|
|
|
|
|
|
|
|
LL | S(_, _) => {}
|
|
|
|
| ^^^
|
2021-01-12 22:39:51 -06:00
|
|
|
help: use `..` to ignore all fields
|
|
|
|
|
|
|
|
|
LL | S(..) => {}
|
|
|
|
| ^^
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 2 fields
|
2021-01-12 22:39:51 -06:00
|
|
|
--> $DIR/pat-tuple-underfield.rs:20:9
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
|
LL | struct S(i32, f32);
|
|
|
|
| ------------------- tuple struct defined here
|
|
|
|
...
|
|
|
|
LL | S() => {}
|
|
|
|
| ^^^ expected 2 fields, found 0
|
|
|
|
|
|
|
|
|
help: use `_` to explicitly ignore each field
|
|
|
|
|
|
|
|
|
LL | S(_, _) => {}
|
|
|
|
| ^^^^
|
2020-12-18 22:17:09 -06:00
|
|
|
help: use `..` to ignore all fields
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
|
LL | S(..) => {}
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
|
2021-01-12 22:39:51 -06:00
|
|
|
--> $DIR/pat-tuple-underfield.rs:27:9
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
|
LL | S(i32, f32),
|
|
|
|
| ----------- tuple variant defined here
|
|
|
|
...
|
|
|
|
LL | E::S(x) => {}
|
2021-01-12 21:06:20 -06:00
|
|
|
| ^^^^^^^ expected 2 fields, found 1
|
|
|
|
|
|
|
|
|
help: use `_` to explicitly ignore each field
|
|
|
|
|
|
|
|
|
LL | E::S(x, _) => {}
|
|
|
|
| ^^^
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
|
2021-01-12 22:39:51 -06:00
|
|
|
--> $DIR/pat-tuple-underfield.rs:32:9
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
|
LL | S(i32, f32),
|
|
|
|
| ----------- tuple variant defined here
|
|
|
|
...
|
|
|
|
LL | E::S(_) => {}
|
2021-01-12 21:06:20 -06:00
|
|
|
| ^^^^^^^ expected 2 fields, found 1
|
|
|
|
|
|
|
|
|
help: use `_` to explicitly ignore each field
|
|
|
|
|
|
|
|
|
LL | E::S(_, _) => {}
|
|
|
|
| ^^^
|
2021-01-12 22:39:51 -06:00
|
|
|
help: use `..` to ignore all fields
|
|
|
|
|
|
|
|
|
LL | E::S(..) => {}
|
|
|
|
| ^^
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 2 fields
|
2021-01-12 22:39:51 -06:00
|
|
|
--> $DIR/pat-tuple-underfield.rs:38:9
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
|
LL | S(i32, f32),
|
|
|
|
| ----------- tuple variant defined here
|
|
|
|
...
|
|
|
|
LL | E::S() => {}
|
|
|
|
| ^^^^^^ expected 2 fields, found 0
|
|
|
|
|
|
|
|
|
help: use `_` to explicitly ignore each field
|
|
|
|
|
|
|
|
|
LL | E::S(_, _) => {}
|
|
|
|
| ^^^^
|
2020-12-18 22:17:09 -06:00
|
|
|
help: use `..` to ignore all fields
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
|
LL | E::S(..) => {}
|
|
|
|
| ^^
|
|
|
|
|
2021-01-12 18:47:04 -06:00
|
|
|
error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 4 fields
|
2021-01-12 22:39:51 -06:00
|
|
|
--> $DIR/pat-tuple-underfield.rs:50:9
|
2021-01-12 18:47:04 -06:00
|
|
|
|
|
|
|
|
LL | struct Point4(i32, i32, i32, i32);
|
|
|
|
| ---------------------------------- tuple struct defined here
|
|
|
|
...
|
|
|
|
LL | Point4( a , _ ) => {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 4 fields, found 2
|
|
|
|
|
|
|
|
|
help: use `_` to explicitly ignore each field
|
|
|
|
|
|
|
|
|
LL | Point4( a , _ , _, _) => {}
|
|
|
|
| ^^^^^^
|
|
|
|
help: use `..` to ignore the rest of the fields
|
|
|
|
|
|
2021-01-26 18:53:56 -06:00
|
|
|
LL | Point4( a, ..) => {}
|
|
|
|
| ^^^^
|
2021-01-12 18:47:04 -06:00
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
2020-12-13 16:13:52 -06:00
|
|
|
|
|
|
|
Some errors have detailed explanations: E0023, E0532.
|
|
|
|
For more information about an error, try `rustc --explain E0023`.
|