fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
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 closure `{closure@$DIR/struct-literal-restrictions-in-lamda.rs:12:11: 12:13}` 28help: use parentheses to call this closure 29 | 30LL ~ while (|| Foo { 31LL | x: 3 32LL ~ }.hi())() { 33 | 34 35error: aborting due to 2 previous errors 36 37For more information about this error, try `rustc --explain E0308`.