rust/tests/ui/parser/struct-literal-restrictions-in-lamda.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
923 B
Plaintext
Raw Normal View History

error: struct literals are not allowed here
--> $DIR/struct-literal-restrictions-in-lamda.rs:12:14
|
LL | while || Foo {
| ______________^
LL | | x: 3
LL | | }.hi() {
| |_____^
|
2019-05-02 22:53:09 +00:00
help: surround the struct literal with parentheses
|
LL ~ while || (Foo {
LL | x: 3
LL ~ }).hi() {
2018-10-20 20:36:17 +00:00
|
error[E0308]: mismatched types
--> $DIR/struct-literal-restrictions-in-lamda.rs:12:11
|
LL | while || Foo {
| ___________^
LL | | x: 3
LL | | }.hi() {
| |__________^ expected `bool`, found closure
|
= note: expected type `bool`
2022-06-27 05:45:35 +00:00
found closure `[closure@$DIR/struct-literal-restrictions-in-lamda.rs:12:11: 12:13]`
help: use parentheses to call this closure
|
LL ~ while (|| Foo {
LL | x: 3
LL ~ }.hi())() {
|
error: aborting due to 2 previous errors
2018-10-20 20:36:17 +00:00
For more information about this error, try `rustc --explain E0308`.