mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
25 lines
896 B
Plaintext
25 lines
896 B
Plaintext
error: expected identifier, found reserved identifier `_`
|
|
--> $DIR/struct-enum-ignoring-field-with-underscore.rs:9:27
|
|
|
|
|
LL | if let Some(Foo::Bar {_}) = foo {}
|
|
| ^ expected identifier, found reserved identifier
|
|
|
|
error[E0027]: pattern does not mention field `bar`
|
|
--> $DIR/struct-enum-ignoring-field-with-underscore.rs:9:17
|
|
|
|
|
LL | if let Some(Foo::Bar {_}) = foo {}
|
|
| ^^^^^^^^^^^^ missing field `bar`
|
|
|
|
|
help: include the missing field in the pattern
|
|
|
|
|
LL | if let Some(Foo::Bar {_, bar }) = foo {}
|
|
| ~~~~~~~
|
|
help: if you don't care about this missing field, you can explicitly ignore it
|
|
|
|
|
LL | if let Some(Foo::Bar {_, .. }) = foo {}
|
|
| ~~~~~~
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0027`.
|