about summary refs log tree commit diff
path: root/src/test/ui/empty
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/empty')
-rw-r--r--src/test/ui/empty/empty-struct-braces-expr.stderr60
-rw-r--r--src/test/ui/empty/empty-struct-braces-pat-1.stderr16
-rw-r--r--src/test/ui/empty/empty-struct-braces-pat-2.stderr72
-rw-r--r--src/test/ui/empty/empty-struct-braces-pat-3.stderr42
4 files changed, 108 insertions, 82 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
diff --git a/src/test/ui/empty/empty-struct-braces-pat-1.stderr b/src/test/ui/empty/empty-struct-braces-pat-1.stderr
index 0ff21c91b78..b027c82f7dd 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-1.stderr
+++ b/src/test/ui/empty/empty-struct-braces-pat-1.stderr
@@ -5,21 +5,27 @@ LL |     Empty3 {}
    |     --------- `E::Empty3` defined here
 ...
 LL |         E::Empty3 => ()
-   |         ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`?
+   |         ^^^^^^^^^ help: use struct pattern syntax instead: `E::Empty3 {}`
 
 error[E0532]: expected unit struct, unit variant or constant, found struct variant `XE::XEmpty3`
   --> $DIR/empty-struct-braces-pat-1.rs:31:9
    |
 LL |         XE::XEmpty3 => ()
-   |         ^^^^-------
-   |         |   |
-   |         |   help: a unit variant with a similar name exists: `XEmpty4`
-   |         did you mean `XE::XEmpty3 { /* fields */ }`?
+   |         ^^^^^^^^^^^
    | 
   ::: $DIR/auxiliary/empty-struct.rs:7:5
    |
 LL |     XEmpty4,
    |     ------- similarly named unit variant `XEmpty4` defined here
+   |
+help: a unit variant with a similar name exists
+   |
+LL |         XE::XEmpty4 => ()
+   |             ^^^^^^^
+help: use struct pattern syntax instead
+   |
+LL |         XE::XEmpty3 { /* fields */ } => ()
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/empty/empty-struct-braces-pat-2.stderr b/src/test/ui/empty/empty-struct-braces-pat-2.stderr
index 80c29db8d9b..a53b88db7d1 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-2.stderr
+++ b/src/test/ui/empty/empty-struct-braces-pat-2.stderr
@@ -5,29 +5,31 @@ LL | struct Empty1 {}
    | ---------------- `Empty1` defined here
 ...
 LL |         Empty1() => ()
-   |         ^^^^^^
-   |         |
-   |         did you mean `Empty1 { /* fields */ }`?
-   |         help: a tuple struct with a similar name exists: `XEmpty6`
-   | 
-  ::: $DIR/auxiliary/empty-struct.rs:3:1
-   |
-LL | pub struct XEmpty6();
-   | --------------------- similarly named tuple struct `XEmpty6` defined here
+   |         ^^^^^^^^
+   |
+help: a tuple struct with a similar name exists
+   |
+LL |         XEmpty6() => ()
+   |         ^^^^^^^
+help: use struct pattern syntax instead
+   |
+LL |         Empty1 {} => ()
+   |         ^^^^^^^^^
 
 error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1`
   --> $DIR/empty-struct-braces-pat-2.rs:18:9
    |
 LL |         XEmpty1() => ()
+   |         ^^^^^^^^^
+   |
+help: a tuple struct with a similar name exists
+   |
+LL |         XEmpty6() => ()
    |         ^^^^^^^
-   |         |
-   |         did you mean `XEmpty1 { /* fields */ }`?
-   |         help: a tuple struct with a similar name exists: `XEmpty6`
-   | 
-  ::: $DIR/auxiliary/empty-struct.rs:3:1
-   |
-LL | pub struct XEmpty6();
-   | --------------------- similarly named tuple struct `XEmpty6` defined here
+help: use struct pattern syntax instead
+   |
+LL |         XEmpty1 {} => ()
+   |         ^^^^^^^^^^
 
 error[E0532]: expected tuple struct or tuple variant, found struct `Empty1`
   --> $DIR/empty-struct-braces-pat-2.rs:21:9
@@ -36,29 +38,31 @@ LL | struct Empty1 {}
    | ---------------- `Empty1` defined here
 ...
 LL |         Empty1(..) => ()
-   |         ^^^^^^
-   |         |
-   |         did you mean `Empty1 { /* fields */ }`?
-   |         help: a tuple struct with a similar name exists: `XEmpty6`
-   | 
-  ::: $DIR/auxiliary/empty-struct.rs:3:1
-   |
-LL | pub struct XEmpty6();
-   | --------------------- similarly named tuple struct `XEmpty6` defined here
+   |         ^^^^^^^^^^
+   |
+help: a tuple struct with a similar name exists
+   |
+LL |         XEmpty6(..) => ()
+   |         ^^^^^^^
+help: use struct pattern syntax instead
+   |
+LL |         Empty1 {} => ()
+   |         ^^^^^^^^^
 
 error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1`
   --> $DIR/empty-struct-braces-pat-2.rs:24:9
    |
 LL |         XEmpty1(..) => ()
+   |         ^^^^^^^^^^^
+   |
+help: a tuple struct with a similar name exists
+   |
+LL |         XEmpty6(..) => ()
    |         ^^^^^^^
-   |         |
-   |         did you mean `XEmpty1 { /* fields */ }`?
-   |         help: a tuple struct with a similar name exists: `XEmpty6`
-   | 
-  ::: $DIR/auxiliary/empty-struct.rs:3:1
-   |
-LL | pub struct XEmpty6();
-   | --------------------- similarly named tuple struct `XEmpty6` defined here
+help: use struct pattern syntax instead
+   |
+LL |         XEmpty1 {} => ()
+   |         ^^^^^^^^^^
 
 error: aborting due to 4 previous errors
 
diff --git a/src/test/ui/empty/empty-struct-braces-pat-3.stderr b/src/test/ui/empty/empty-struct-braces-pat-3.stderr
index 05439b39ea3..93ace3eccef 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-3.stderr
+++ b/src/test/ui/empty/empty-struct-braces-pat-3.stderr
@@ -5,21 +5,22 @@ LL |     Empty3 {}
    |     --------- `E::Empty3` defined here
 ...
 LL |         E::Empty3() => ()
-   |         ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`?
+   |         ^^^^^^^^^^^ help: use struct pattern syntax instead: `E::Empty3 {}`
 
 error[E0532]: expected tuple struct or tuple variant, found struct variant `XE::XEmpty3`
   --> $DIR/empty-struct-braces-pat-3.rs:21:9
    |
 LL |         XE::XEmpty3() => ()
-   |         ^^^^-------
-   |         |   |
-   |         |   help: a tuple variant with a similar name exists: `XEmpty5`
-   |         did you mean `XE::XEmpty3 { /* fields */ }`?
-   | 
-  ::: $DIR/auxiliary/empty-struct.rs:8:5
-   |
-LL |     XEmpty5(),
-   |     --------- similarly named tuple variant `XEmpty5` defined here
+   |         ^^^^^^^^^^^^^
+   |
+help: a tuple variant with a similar name exists
+   |
+LL |         XE::XEmpty5() => ()
+   |             ^^^^^^^
+help: use struct pattern syntax instead
+   |
+LL |         XE::XEmpty3 { /* fields */ } => ()
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0532]: expected tuple struct or tuple variant, found struct variant `E::Empty3`
   --> $DIR/empty-struct-braces-pat-3.rs:25:9
@@ -28,21 +29,22 @@ LL |     Empty3 {}
    |     --------- `E::Empty3` defined here
 ...
 LL |         E::Empty3(..) => ()
-   |         ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`?
+   |         ^^^^^^^^^^^^^ help: use struct pattern syntax instead: `E::Empty3 {}`
 
 error[E0532]: expected tuple struct or tuple variant, found struct variant `XE::XEmpty3`
   --> $DIR/empty-struct-braces-pat-3.rs:29:9
    |
 LL |         XE::XEmpty3(..) => ()
-   |         ^^^^-------
-   |         |   |
-   |         |   help: a tuple variant with a similar name exists: `XEmpty5`
-   |         did you mean `XE::XEmpty3 { /* fields */ }`?
-   | 
-  ::: $DIR/auxiliary/empty-struct.rs:8:5
-   |
-LL |     XEmpty5(),
-   |     --------- similarly named tuple variant `XEmpty5` defined here
+   |         ^^^^^^^^^^^^^^^
+   |
+help: a tuple variant with a similar name exists
+   |
+LL |         XE::XEmpty5(..) => ()
+   |             ^^^^^^^
+help: use struct pattern syntax instead
+   |
+LL |         XE::XEmpty3 { /* fields */ } => ()
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 4 previous errors