]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/parser/struct-literal-in-if.stderr
Merge commit '54a20a02ecd0e1352a871aa0990bcc8b8b03173e' into clippyup
[rust.git] / src / test / ui / parser / struct-literal-in-if.stderr
index 3dd61e74f12eda67e9808948cc727bda1b915b25..7a64a42e3c8aa13195ed5a57ad97d487cf463cc5 100644 (file)
@@ -1,29 +1,18 @@
-error: expected type, found `3`
-  --> $DIR/struct-literal-in-if.rs:13:12
+error: struct literals are not allowed here
+  --> $DIR/struct-literal-in-if.rs:12:8
    |
-LL |         x: 3
-   |            ^ expecting a type here because of type ascription
+LL |       if Foo {
+   |  ________^
+LL | |         x: 3
+LL | |     }.hi() {
+   | |_____^
    |
-   = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression expects an ascribed type after the colon
-  --> $DIR/struct-literal-in-if.rs:13:9
+help: surround the struct literal with parentheses
    |
+LL |     if (Foo {
 LL |         x: 3
-   |         ^
-   = help: this might be indicative of a syntax error elsewhere
-
-error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
-  --> $DIR/struct-literal-in-if.rs:14:12
-   |
-LL |     }.hi() {
-   |            ^ expected one of `.`, `;`, `?`, `}`, or an operator here
-
-error[E0423]: expected value, found struct `Foo`
-  --> $DIR/struct-literal-in-if.rs:12:8
+LL |     }).hi() {
    |
-LL |     if Foo {
-   |        ^^^ did you mean `(Foo { /* fields */ })`?
 
-error: aborting due to 3 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0423`.