rust/tests/ui/error-codes/E0023.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
1.9 KiB
Plaintext
Raw Normal View History

2018-02-07 21:35:35 -06:00
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
2021-08-18 18:13:52 -05:00
--> $DIR/E0023.rs:11:22
2018-02-07 21:35:35 -06:00
|
LL | Apple(String, String),
2021-08-18 18:13:52 -05:00
| ------ ------ tuple variant has 2 fields
...
2019-03-09 06:03:44 -06:00
LL | Fruit::Apple(a) => {},
| ^ expected 2 fields, found 1
|
help: use `_` to explicitly ignore each field
|
LL | Fruit::Apple(a, _) => {},
| +++
2018-02-07 21:35:35 -06:00
error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
2021-08-18 18:13:52 -05:00
--> $DIR/E0023.rs:12:22
2018-02-07 21:35:35 -06:00
|
LL | Apple(String, String),
2021-08-18 18:13:52 -05:00
| ------ ------ tuple variant has 2 fields
...
2019-03-09 06:03:44 -06:00
LL | Fruit::Apple(a, b, c) => {},
| ^ ^ ^ expected 2 fields, found 3
2018-02-07 21:35:35 -06:00
error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
2021-08-18 18:13:52 -05:00
--> $DIR/E0023.rs:13:21
2018-02-07 21:35:35 -06:00
|
LL | Pear(u32),
2021-08-18 18:13:52 -05:00
| --- tuple variant has 1 field
...
2019-03-09 06:03:44 -06:00
LL | Fruit::Pear(1, 2) => {},
| ^ ^ expected 1 field, found 2
2018-02-07 21:35:35 -06:00
error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
2021-08-18 18:13:52 -05:00
--> $DIR/E0023.rs:14:23
|
LL | Orange((String, String)),
2021-08-18 18:13:52 -05:00
| ---------------- tuple variant has 1 field
...
LL | Fruit::Orange(a, b) => {},
| ^ ^ expected 1 field, found 2
|
help: missing parentheses
|
LL | Fruit::Orange((a, b)) => {},
| + +
error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 1 field
--> $DIR/E0023.rs:15:9
|
LL | Banana(()),
2021-08-18 18:13:52 -05:00
| -- tuple variant has 1 field
...
LL | Fruit::Banana() => {},
| ^^^^^^^^^^^^^^^ expected 1 field, found 0
|
help: missing parentheses
|
LL | Fruit::Banana(()) => {},
| + +
error: aborting due to 5 previous errors
2018-02-07 21:35:35 -06:00
2018-03-03 08:59:40 -06:00
For more information about this error, try `rustc --explain E0023`.