fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

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