]>
Commit | Line | Data |
---|---|---|
48663c56 XL |
1 | error: struct literals are not allowed here |
2 | --> $DIR/struct-literal-restrictions-in-lamda.rs:12:14 | |
532ac7d7 | 3 | | |
48663c56 XL |
4 | LL | while || Foo { |
5 | | ______________^ | |
6 | LL | | x: 3 | |
7 | LL | | }.hi() { | |
8 | | |_____^ | |
e74abb32 | 9 | | |
48663c56 | 10 | help: surround the struct literal with parentheses |
532ac7d7 | 11 | | |
48663c56 | 12 | LL | while || (Foo { |
532ac7d7 | 13 | LL | x: 3 |
48663c56 | 14 | LL | }).hi() { |
0bf4aa26 | 15 | | |
0bf4aa26 | 16 | |
48663c56 XL |
17 | error[E0308]: mismatched types |
18 | --> $DIR/struct-literal-restrictions-in-lamda.rs:12:11 | |
0731742a | 19 | | |
48663c56 XL |
20 | LL | while || Foo { |
21 | | ___________^ | |
22 | LL | | x: 3 | |
23 | LL | | }.hi() { | |
60c5eb7d | 24 | | |__________^ expected `bool`, found closure |
0731742a | 25 | | |
48663c56 | 26 | = note: expected type `bool` |
60c5eb7d | 27 | found closure `[closure@$DIR/struct-literal-restrictions-in-lamda.rs:12:11: 14:11]` |
0731742a | 28 | |
48663c56 | 29 | error: aborting due to 2 previous errors |
0bf4aa26 | 30 | |
48663c56 | 31 | For more information about this error, try `rustc --explain E0308`. |