]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/struct-literal-restrictions-in-lamda.stderr
Rollup merge of #106638 - RalfJung:realstd, r=thomcc
[rust.git] / tests / ui / parser / struct-literal-restrictions-in-lamda.stderr
1 error: struct literals are not allowed here
2   --> $DIR/struct-literal-restrictions-in-lamda.rs:12:14
3    |
4 LL |       while || Foo {
5    |  ______________^
6 LL | |         x: 3
7 LL | |     }.hi() {
8    | |_____^
9    |
10 help: surround the struct literal with parentheses
11    |
12 LL ~     while || (Foo {
13 LL |         x: 3
14 LL ~     }).hi() {
15    |
16
17 error[E0308]: mismatched types
18   --> $DIR/struct-literal-restrictions-in-lamda.rs:12:11
19    |
20 LL |       while || Foo {
21    |  ___________^
22 LL | |         x: 3
23 LL | |     }.hi() {
24    | |__________^ expected `bool`, found closure
25    |
26    = note: expected type `bool`
27            found closure `[closure@$DIR/struct-literal-restrictions-in-lamda.rs:12:11: 12:13]`
28 help: use parentheses to call this closure
29    |
30 LL ~     while (|| Foo {
31 LL |         x: 3
32 LL ~     }.hi())() {
33    |
34
35 error: aborting due to 2 previous errors
36
37 For more information about this error, try `rustc --explain E0308`.