about summary refs log tree commit diff
path: root/src/test/ui/empty/empty-struct-braces-expr.stderr
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-07-14 13:19:22 -0700
committerGitHub <noreply@github.com>2020-07-14 13:19:22 -0700
commitbe5c7abfd6c5d366f90cf5b44543a7af2120852e (patch)
tree41bdbb37318928e26a6576bd374cfcd465ec81a2 /src/test/ui/empty/empty-struct-braces-expr.stderr
parent353df59893f4dc249f06047dca659b5b2172063f (diff)
parent04298204ed17eeed4d23aaa45fb0db9336e6583c (diff)
Rollup merge of #74211 - estebank:struct-pat-as-unit, r=petrochenkov
Structured suggestion when not using struct pattern

r? @petrochenkov
Diffstat (limited to 'src/test/ui/empty/empty-struct-braces-expr.stderr')
-rw-r--r--src/test/ui/empty/empty-struct-braces-expr.stderr60
1 files changed, 37 insertions, 23 deletions
diff --git a/src/test/ui/empty/empty-struct-braces-expr.stderr b/src/test/ui/empty/empty-struct-braces-expr.stderr
index 9da3a5f5bdb..c0ba9716fb0 100644
--- a/src/test/ui/empty/empty-struct-braces-expr.stderr
+++ b/src/test/ui/empty/empty-struct-braces-expr.stderr
@@ -6,14 +6,20 @@ LL | struct Empty1 {}
 ...
 LL |     let e1 = Empty1;
    |              ^^^^^^
-   |              |
-   |              did you mean `Empty1 { /* fields */ }`?
-   |              help: a unit struct with a similar name exists: `XEmpty2`
    | 
   ::: $DIR/auxiliary/empty-struct.rs:2:1
    |
 LL | pub struct XEmpty2;
    | ------------------- similarly named unit struct `XEmpty2` defined here
+   |
+help: a unit struct with a similar name exists
+   |
+LL |     let e1 = XEmpty2;
+   |              ^^^^^^^
+help: use struct literal syntax instead
+   |
+LL |     let e1 = Empty1 {};
+   |              ^^^^^^^^^
 
 error[E0423]: expected function, tuple struct or tuple variant, found struct `Empty1`
   --> $DIR/empty-struct-braces-expr.rs:16:14
@@ -22,15 +28,16 @@ LL | struct Empty1 {}
    | ---------------- `Empty1` defined here
 ...
 LL |     let e1 = Empty1();
-   |              ^^^^^^
-   |              |
-   |              did you mean `Empty1 { /* fields */ }`?
-   |              help: a unit struct with a similar name exists: `XEmpty2`
-   | 
-  ::: $DIR/auxiliary/empty-struct.rs:2:1
+   |              ^^^^^^^^
    |
-LL | pub struct XEmpty2;
-   | ------------------- similarly named unit struct `XEmpty2` defined here
+help: a unit struct with a similar name exists
+   |
+LL |     let e1 = XEmpty2();
+   |              ^^^^^^^
+help: use struct literal syntax instead
+   |
+LL |     let e1 = Empty1 {};
+   |              ^^^^^^^^^
 
 error[E0423]: expected value, found struct variant `E::Empty3`
   --> $DIR/empty-struct-braces-expr.rs:18:14
@@ -39,7 +46,7 @@ LL |     Empty3 {}
    |     --------- `E::Empty3` defined here
 ...
 LL |     let e3 = E::Empty3;
-   |              ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`?
+   |              ^^^^^^^^^ help: use struct literal syntax instead: `E::Empty3 {}`
 
 error[E0423]: expected function, tuple struct or tuple variant, found struct variant `E::Empty3`
   --> $DIR/empty-struct-braces-expr.rs:19:14
@@ -48,35 +55,42 @@ LL |     Empty3 {}
    |     --------- `E::Empty3` defined here
 ...
 LL |     let e3 = E::Empty3();
-   |              ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`?
+   |              ^^^^^^^^^^^ help: use struct literal syntax instead: `E::Empty3 {}`
 
 error[E0423]: expected value, found struct `XEmpty1`
   --> $DIR/empty-struct-braces-expr.rs:22:15
    |
 LL |     let xe1 = XEmpty1;
    |               ^^^^^^^
-   |               |
-   |               did you mean `XEmpty1 { /* fields */ }`?
-   |               help: a unit struct with a similar name exists: `XEmpty2`
    | 
   ::: $DIR/auxiliary/empty-struct.rs:2:1
    |
 LL | pub struct XEmpty2;
    | ------------------- similarly named unit struct `XEmpty2` defined here
+   |
+help: a unit struct with a similar name exists
+   |
+LL |     let xe1 = XEmpty2;
+   |               ^^^^^^^
+help: use struct literal syntax instead
+   |
+LL |     let xe1 = XEmpty1 {};
+   |               ^^^^^^^^^^
 
 error[E0423]: expected function, tuple struct or tuple variant, found struct `XEmpty1`
   --> $DIR/empty-struct-braces-expr.rs:23:15
    |
 LL |     let xe1 = XEmpty1();
+   |               ^^^^^^^^^
+   |
+help: a unit struct with a similar name exists
+   |
+LL |     let xe1 = XEmpty2();
    |               ^^^^^^^
-   |               |
-   |               did you mean `XEmpty1 { /* fields */ }`?
-   |               help: a unit struct with a similar name exists: `XEmpty2`
-   | 
-  ::: $DIR/auxiliary/empty-struct.rs:2:1
+help: use struct literal syntax instead
    |
-LL | pub struct XEmpty2;
-   | ------------------- similarly named unit struct `XEmpty2` defined here
+LL |     let xe1 = XEmpty1 {};
+   |               ^^^^^^^^^^
 
 error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope
   --> $DIR/empty-struct-braces-expr.rs:25:19