]> git.lizzy.rs Git - rust.git/blob - src/test/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
[rust.git] / src / test / ui / structs-enums / struct-enum-ignoring-field-with-underscore.stderr
1 error: expected identifier, found reserved identifier `_`
2   --> $DIR/struct-enum-ignoring-field-with-underscore.rs:9:27
3    |
4 LL |     if let Some(Foo::Bar {_}) = foo {}
5    |                           ^ expected identifier, found reserved identifier
6
7 error[E0027]: pattern does not mention field `bar`
8   --> $DIR/struct-enum-ignoring-field-with-underscore.rs:9:17
9    |
10 LL |     if let Some(Foo::Bar {_}) = foo {}
11    |                 ^^^^^^^^^^^^ missing field `bar`
12    |
13 help: include the missing field in the pattern
14    |
15 LL |     if let Some(Foo::Bar {_, bar }) = foo {}
16    |                            ~~~~~~~
17 help: if you don't care about this missing field, you can explicitly ignore it
18    |
19 LL |     if let Some(Foo::Bar {_, .. }) = foo {}
20    |                            ~~~~~~
21
22 error: aborting due to 2 previous errors
23
24 For more information about this error, try `rustc --explain E0027`.