fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
799 B30 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   | |_____^
9help: surround the struct literal with parentheses
10   |
11LL |     while || (Foo {
12LL |         x: 3
13LL |     }).hi() {
14   |
15
16error[E0308]: mismatched types
17  --> $DIR/struct-literal-restrictions-in-lamda.rs:12:11
18   |
19LL |       while || Foo {
20   |  ___________^
21LL | |         x: 3
22LL | |     }.hi() {
23   | |__________^ expected bool, found closure
24   |
25   = note: expected type `bool`
26              found type `[closure@$DIR/struct-literal-restrictions-in-lamda.rs:12:11: 14:11]`
27
28error: aborting due to 2 previous errors
29
30For more information about this error, try `rustc --explain E0308`.