about summary refs log tree commit diff
path: root/src/test/ui/empty
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-10-14 17:20:50 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-10-27 11:50:43 -0700
commitb26ddb8af37362e33c45c78c9c91a3c5cdabfe7e (patch)
tree13882f89b25e139a8e0997d8c7146bc15b0483c0 /src/test/ui/empty
parent0f677c65e867d93a47ccbaeaf6e6725cde8c5ff6 (diff)
downloadrust-b26ddb8af37362e33c45c78c9c91a3c5cdabfe7e.tar.gz
rust-b26ddb8af37362e33c45c78c9c91a3c5cdabfe7e.zip
Point at local similarly named element and tweak references to variants
Point at the span for the definition of ADTs internal to the current
crate.

Look at the leading char of the ident to determine whether we're
expecting a likely fn or any of a fn, a tuple struct or a tuple variant.

Turn fn `add_typo_suggestion` into a `Resolver` method.
Diffstat (limited to 'src/test/ui/empty')
-rw-r--r--src/test/ui/empty/empty-struct-braces-expr.rs9
-rw-r--r--src/test/ui/empty/empty-struct-braces-expr.stderr20
-rw-r--r--src/test/ui/empty/empty-struct-braces-pat-1.rs4
-rw-r--r--src/test/ui/empty/empty-struct-braces-pat-1.stderr4
-rw-r--r--src/test/ui/empty/empty-struct-braces-pat-2.rs8
-rw-r--r--src/test/ui/empty/empty-struct-braces-pat-2.stderr8
-rw-r--r--src/test/ui/empty/empty-struct-braces-pat-3.rs8
-rw-r--r--src/test/ui/empty/empty-struct-braces-pat-3.stderr8
-rw-r--r--src/test/ui/empty/empty-struct-tuple-pat.rs4
-rw-r--r--src/test/ui/empty/empty-struct-tuple-pat.stderr4
-rw-r--r--src/test/ui/empty/empty-struct-unit-pat.rs21
-rw-r--r--src/test/ui/empty/empty-struct-unit-pat.stderr32
12 files changed, 69 insertions, 61 deletions
diff --git a/src/test/ui/empty/empty-struct-braces-expr.rs b/src/test/ui/empty/empty-struct-braces-expr.rs
index e33fcb70db7..1a38d3d7601 100644
--- a/src/test/ui/empty/empty-struct-braces-expr.rs
+++ b/src/test/ui/empty/empty-struct-braces-expr.rs
@@ -13,12 +13,15 @@ enum E {
 
 fn main() {
     let e1 = Empty1; //~ ERROR expected value, found struct `Empty1`
-    let e1 = Empty1(); //~ ERROR expected function, found struct `Empty1`
+    let e1 = Empty1();
+    //~^ ERROR expected function, tuple struct or tuple variant, found struct `Empty1`
     let e3 = E::Empty3; //~ ERROR expected value, found struct variant `E::Empty3`
-    let e3 = E::Empty3(); //~ ERROR expected function, found struct variant `E::Empty3`
+    let e3 = E::Empty3();
+    //~^ ERROR expected function, tuple struct or tuple variant, found struct variant `E::Empty3`
 
     let xe1 = XEmpty1; //~ ERROR expected value, found struct `XEmpty1`
-    let xe1 = XEmpty1(); //~ ERROR expected function, found struct `XEmpty1`
+    let xe1 = XEmpty1();
+    //~^ ERROR expected function, tuple struct or tuple variant, found struct `XEmpty1`
     let xe3 = XE::Empty3; //~ ERROR no variant or associated item named `Empty3` found for type
     let xe3 = XE::Empty3(); //~ ERROR no variant or associated item named `Empty3` found for type
 
diff --git a/src/test/ui/empty/empty-struct-braces-expr.stderr b/src/test/ui/empty/empty-struct-braces-expr.stderr
index 97121575527..f427c1ba0ad 100644
--- a/src/test/ui/empty/empty-struct-braces-expr.stderr
+++ b/src/test/ui/empty/empty-struct-braces-expr.stderr
@@ -10,7 +10,7 @@ LL |     let e1 = Empty1;
    |              did you mean `Empty1 { /* fields */ }`?
    |              help: a unit struct with a similar name exists: `XEmpty2`
 
-error[E0423]: expected function, found struct `Empty1`
+error[E0423]: expected function, tuple struct or tuple variant, found struct `Empty1`
   --> $DIR/empty-struct-braces-expr.rs:16:14
    |
 LL | struct Empty1 {}
@@ -23,7 +23,7 @@ LL |     let e1 = Empty1();
    |              help: a unit struct with a similar name exists: `XEmpty2`
 
 error[E0423]: expected value, found struct variant `E::Empty3`
-  --> $DIR/empty-struct-braces-expr.rs:17:14
+  --> $DIR/empty-struct-braces-expr.rs:18:14
    |
 LL |     Empty3 {}
    |     --------- `E::Empty3` defined here
@@ -31,8 +31,8 @@ LL |     Empty3 {}
 LL |     let e3 = E::Empty3;
    |              ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`?
 
-error[E0423]: expected function, found struct variant `E::Empty3`
-  --> $DIR/empty-struct-braces-expr.rs:18:14
+error[E0423]: expected function, tuple struct or tuple variant, found struct variant `E::Empty3`
+  --> $DIR/empty-struct-braces-expr.rs:19:14
    |
 LL |     Empty3 {}
    |     --------- `E::Empty3` defined here
@@ -41,7 +41,7 @@ LL |     let e3 = E::Empty3();
    |              ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`?
 
 error[E0423]: expected value, found struct `XEmpty1`
-  --> $DIR/empty-struct-braces-expr.rs:20:15
+  --> $DIR/empty-struct-braces-expr.rs:22:15
    |
 LL |     let xe1 = XEmpty1;
    |               ^^^^^^^
@@ -49,8 +49,8 @@ LL |     let xe1 = XEmpty1;
    |               did you mean `XEmpty1 { /* fields */ }`?
    |               help: a unit struct with a similar name exists: `XEmpty2`
 
-error[E0423]: expected function, found struct `XEmpty1`
-  --> $DIR/empty-struct-braces-expr.rs:21:15
+error[E0423]: expected function, tuple struct or tuple variant, found struct `XEmpty1`
+  --> $DIR/empty-struct-braces-expr.rs:23:15
    |
 LL |     let xe1 = XEmpty1();
    |               ^^^^^^^
@@ -59,7 +59,7 @@ LL |     let xe1 = XEmpty1();
    |               help: a unit struct with a similar name exists: `XEmpty2`
 
 error[E0599]: no variant or associated item named `Empty3` found for type `empty_struct::XE` in the current scope
-  --> $DIR/empty-struct-braces-expr.rs:22:19
+  --> $DIR/empty-struct-braces-expr.rs:25:19
    |
 LL |     let xe3 = XE::Empty3;
    |                   ^^^^^^
@@ -68,7 +68,7 @@ LL |     let xe3 = XE::Empty3;
    |                   help: there is a variant with a similar name: `XEmpty3`
 
 error[E0599]: no variant or associated item named `Empty3` found for type `empty_struct::XE` in the current scope
-  --> $DIR/empty-struct-braces-expr.rs:23:19
+  --> $DIR/empty-struct-braces-expr.rs:26:19
    |
 LL |     let xe3 = XE::Empty3();
    |                   ^^^^^^
@@ -77,7 +77,7 @@ LL |     let xe3 = XE::Empty3();
    |                   help: there is a variant with a similar name: `XEmpty3`
 
 error: no variant `Empty1` in enum `empty_struct::XE`
-  --> $DIR/empty-struct-braces-expr.rs:25:9
+  --> $DIR/empty-struct-braces-expr.rs:28:9
    |
 LL |     XE::Empty1 {};
    |         ^^^^^^ help: there is a variant with a similar name: `XEmpty3`
diff --git a/src/test/ui/empty/empty-struct-braces-pat-1.rs b/src/test/ui/empty/empty-struct-braces-pat-1.rs
index 81062320fe4..9bed93f9c15 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-1.rs
+++ b/src/test/ui/empty/empty-struct-braces-pat-1.rs
@@ -22,13 +22,13 @@ fn main() {
     }
     match e3 {
         E::Empty3 => ()
-        //~^ ERROR expected unit struct/variant or constant, found struct variant `E::Empty3`
+        //~^ ERROR expected unit struct, unit variant or constant, found struct variant `E::Empty3`
     }
     match xe1 {
         XEmpty1 => () // Not an error, `XEmpty1` is interpreted as a new binding
     }
     match xe3 {
         XE::XEmpty3 => ()
-        //~^ ERROR expected unit struct/variant or constant, found struct variant `XE::XEmpty3`
+    //~^ ERROR expected unit struct, unit variant or constant, found struct variant `XE::XEmpty3`
     }
 }
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 271e811a2fd..9b5f31157d1 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-1.stderr
+++ b/src/test/ui/empty/empty-struct-braces-pat-1.stderr
@@ -1,4 +1,4 @@
-error[E0532]: expected unit struct/variant or constant, found struct variant `E::Empty3`
+error[E0532]: expected unit struct, unit variant or constant, found struct variant `E::Empty3`
   --> $DIR/empty-struct-braces-pat-1.rs:24:9
    |
 LL |     Empty3 {}
@@ -7,7 +7,7 @@ LL |     Empty3 {}
 LL |         E::Empty3 => ()
    |         ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`?
 
-error[E0532]: expected unit struct/variant or constant, found struct variant `XE::XEmpty3`
+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 => ()
diff --git a/src/test/ui/empty/empty-struct-braces-pat-2.rs b/src/test/ui/empty/empty-struct-braces-pat-2.rs
index 187d953d805..cfe4641f356 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-2.rs
+++ b/src/test/ui/empty/empty-struct-braces-pat-2.rs
@@ -12,15 +12,15 @@ fn main() {
     let xe1 = XEmpty1 {};
 
     match e1 {
-        Empty1() => () //~ ERROR expected tuple struct/variant, found struct `Empty1`
+        Empty1() => () //~ ERROR expected tuple struct or tuple variant, found struct `Empty1`
     }
     match xe1 {
-        XEmpty1() => () //~ ERROR expected tuple struct/variant, found struct `XEmpty1`
+        XEmpty1() => () //~ ERROR expected tuple struct or tuple variant, found struct `XEmpty1`
     }
     match e1 {
-        Empty1(..) => () //~ ERROR expected tuple struct/variant, found struct `Empty1`
+        Empty1(..) => () //~ ERROR expected tuple struct or tuple variant, found struct `Empty1`
     }
     match xe1 {
-        XEmpty1(..) => () //~ ERROR expected tuple struct/variant, found struct `XEmpty1`
+        XEmpty1(..) => () //~ ERROR expected tuple struct or tuple variant, found struct `XEmpty1`
     }
 }
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 33524737888..0b3c9ae5151 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-2.stderr
+++ b/src/test/ui/empty/empty-struct-braces-pat-2.stderr
@@ -1,4 +1,4 @@
-error[E0532]: expected tuple struct/variant, found struct `Empty1`
+error[E0532]: expected tuple struct or tuple variant, found struct `Empty1`
   --> $DIR/empty-struct-braces-pat-2.rs:15:9
    |
 LL | struct Empty1 {}
@@ -10,7 +10,7 @@ LL |         Empty1() => ()
    |         did you mean `Empty1 { /* fields */ }`?
    |         help: a tuple struct with a similar name exists: `XEmpty6`
 
-error[E0532]: expected tuple struct/variant, found struct `XEmpty1`
+error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1`
   --> $DIR/empty-struct-braces-pat-2.rs:18:9
    |
 LL |         XEmpty1() => ()
@@ -19,7 +19,7 @@ LL |         XEmpty1() => ()
    |         did you mean `XEmpty1 { /* fields */ }`?
    |         help: a tuple struct with a similar name exists: `XEmpty6`
 
-error[E0532]: expected tuple struct/variant, found struct `Empty1`
+error[E0532]: expected tuple struct or tuple variant, found struct `Empty1`
   --> $DIR/empty-struct-braces-pat-2.rs:21:9
    |
 LL | struct Empty1 {}
@@ -31,7 +31,7 @@ LL |         Empty1(..) => ()
    |         did you mean `Empty1 { /* fields */ }`?
    |         help: a tuple struct with a similar name exists: `XEmpty6`
 
-error[E0532]: expected tuple struct/variant, found struct `XEmpty1`
+error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1`
   --> $DIR/empty-struct-braces-pat-2.rs:24:9
    |
 LL |         XEmpty1(..) => ()
diff --git a/src/test/ui/empty/empty-struct-braces-pat-3.rs b/src/test/ui/empty/empty-struct-braces-pat-3.rs
index fad28d78fe5..54d547eefcc 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-3.rs
+++ b/src/test/ui/empty/empty-struct-braces-pat-3.rs
@@ -15,18 +15,18 @@ fn main() {
 
     match e3 {
         E::Empty3() => ()
-        //~^ ERROR expected tuple struct/variant, found struct variant `E::Empty3`
+        //~^ ERROR expected tuple struct or tuple variant, found struct variant `E::Empty3`
     }
     match xe3 {
         XE::XEmpty3() => ()
-        //~^ ERROR expected tuple struct/variant, found struct variant `XE::XEmpty3`
+        //~^ ERROR expected tuple struct or tuple variant, found struct variant `XE::XEmpty3`
     }
     match e3 {
         E::Empty3(..) => ()
-        //~^ ERROR expected tuple struct/variant, found struct variant `E::Empty3`
+        //~^ ERROR expected tuple struct or tuple variant, found struct variant `E::Empty3`
     }
     match xe3 {
         XE::XEmpty3(..) => ()
-        //~^ ERROR expected tuple struct/variant, found struct variant `XE::XEmpty3
+        //~^ ERROR expected tuple struct or tuple variant, found struct variant `XE::XEmpty3
     }
 }
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 aefdd772b1b..785396c448b 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-3.stderr
+++ b/src/test/ui/empty/empty-struct-braces-pat-3.stderr
@@ -1,4 +1,4 @@
-error[E0532]: expected tuple struct/variant, found struct variant `E::Empty3`
+error[E0532]: expected tuple struct or tuple variant, found struct variant `E::Empty3`
   --> $DIR/empty-struct-braces-pat-3.rs:17:9
    |
 LL |     Empty3 {}
@@ -7,7 +7,7 @@ LL |     Empty3 {}
 LL |         E::Empty3() => ()
    |         ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`?
 
-error[E0532]: expected tuple struct/variant, found struct variant `XE::XEmpty3`
+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() => ()
@@ -16,7 +16,7 @@ LL |         XE::XEmpty3() => ()
    |         |   help: a tuple variant with a similar name exists: `XEmpty5`
    |         did you mean `XE::XEmpty3 { /* fields */ }`?
 
-error[E0532]: expected tuple struct/variant, found struct variant `E::Empty3`
+error[E0532]: expected tuple struct or tuple variant, found struct variant `E::Empty3`
   --> $DIR/empty-struct-braces-pat-3.rs:25:9
    |
 LL |     Empty3 {}
@@ -25,7 +25,7 @@ LL |     Empty3 {}
 LL |         E::Empty3(..) => ()
    |         ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`?
 
-error[E0532]: expected tuple struct/variant, found struct variant `XE::XEmpty3`
+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(..) => ()
diff --git a/src/test/ui/empty/empty-struct-tuple-pat.rs b/src/test/ui/empty/empty-struct-tuple-pat.rs
index 00a48594e93..47da8a306a4 100644
--- a/src/test/ui/empty/empty-struct-tuple-pat.rs
+++ b/src/test/ui/empty/empty-struct-tuple-pat.rs
@@ -27,11 +27,11 @@ fn main() {
 
     match e4 {
         E::Empty4 => ()
-        //~^ ERROR expected unit struct/variant or constant, found tuple variant `E::Empty4`
+        //~^ ERROR expected unit struct, unit variant or constant, found tuple variant `E::Empty4`
     }
     match xe5 {
         XE::XEmpty5 => (),
-        //~^ ERROR expected unit struct/variant or constant, found tuple variant `XE::XEmpty5`
+        //~^ ERROR expected unit struct, unit variant or constant, found tuple variant `XE::XEmpty5`
         _ => {},
     }
 }
diff --git a/src/test/ui/empty/empty-struct-tuple-pat.stderr b/src/test/ui/empty/empty-struct-tuple-pat.stderr
index 4b828c0d942..cfbb468e5e6 100644
--- a/src/test/ui/empty/empty-struct-tuple-pat.stderr
+++ b/src/test/ui/empty/empty-struct-tuple-pat.stderr
@@ -16,7 +16,7 @@ LL | use empty_struct::*;
 LL |         XEmpty6 => ()
    |         ^^^^^^^ cannot be named the same as a tuple struct
 
-error[E0532]: expected unit struct/variant or constant, found tuple variant `E::Empty4`
+error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E::Empty4`
   --> $DIR/empty-struct-tuple-pat.rs:29:9
    |
 LL |     Empty4()
@@ -25,7 +25,7 @@ LL |     Empty4()
 LL |         E::Empty4 => ()
    |         ^^^^^^^^^ did you mean `E::Empty4( /* fields */ )`?
 
-error[E0532]: expected unit struct/variant or constant, found tuple variant `XE::XEmpty5`
+error[E0532]: expected unit struct, unit variant or constant, found tuple variant `XE::XEmpty5`
   --> $DIR/empty-struct-tuple-pat.rs:33:9
    |
 LL |         XE::XEmpty5 => (),
diff --git a/src/test/ui/empty/empty-struct-unit-pat.rs b/src/test/ui/empty/empty-struct-unit-pat.rs
index 8a0e2f505e4..44a1e9e3d93 100644
--- a/src/test/ui/empty/empty-struct-unit-pat.rs
+++ b/src/test/ui/empty/empty-struct-unit-pat.rs
@@ -18,32 +18,37 @@ fn main() {
     let xe4 = XE::XEmpty4;
 
     match e2 {
-        Empty2() => () //~ ERROR expected tuple struct/variant, found unit struct `Empty2`
+        Empty2() => () //~ ERROR expected tuple struct or tuple variant, found unit struct `Empty2`
     }
     match xe2 {
-        XEmpty2() => () //~ ERROR expected tuple struct/variant, found unit struct `XEmpty2`
+        XEmpty2() => ()
+        //~^ ERROR expected tuple struct or tuple variant, found unit struct `XEmpty2`
     }
     match e2 {
-        Empty2(..) => () //~ ERROR expected tuple struct/variant, found unit struct `Empty2`
+        Empty2(..) => ()
+        //~^ ERROR expected tuple struct or tuple variant, found unit struct `Empty2`
     }
     match xe2 {
-        XEmpty2(..) => () //~ ERROR expected tuple struct/variant, found unit struct `XEmpty2`
+        XEmpty2(..) => ()
+        //~^ ERROR expected tuple struct or tuple variant, found unit struct `XEmpty2`
     }
 
     match e4 {
-        E::Empty4() => () //~ ERROR expected tuple struct/variant, found unit variant `E::Empty4`
+        E::Empty4() => ()
+        //~^ ERROR expected tuple struct or tuple variant, found unit variant `E::Empty4`
     }
     match xe4 {
         XE::XEmpty4() => (),
-        //~^ ERROR expected tuple struct/variant, found unit variant `XE::XEmpty4`
+        //~^ ERROR expected tuple struct or tuple variant, found unit variant `XE::XEmpty4`
         _ => {},
     }
     match e4 {
-        E::Empty4(..) => () //~ ERROR expected tuple struct/variant, found unit variant `E::Empty4`
+        E::Empty4(..) => ()
+        //~^ ERROR expected tuple struct or tuple variant, found unit variant `E::Empty4`
     }
     match xe4 {
         XE::XEmpty4(..) => (),
-        //~^ ERROR expected tuple struct/variant, found unit variant `XE::XEmpty4`
+        //~^ ERROR expected tuple struct or tuple variant, found unit variant `XE::XEmpty4`
         _ => {},
     }
 }
diff --git a/src/test/ui/empty/empty-struct-unit-pat.stderr b/src/test/ui/empty/empty-struct-unit-pat.stderr
index 268fc7a6e0c..fd41a6ed382 100644
--- a/src/test/ui/empty/empty-struct-unit-pat.stderr
+++ b/src/test/ui/empty/empty-struct-unit-pat.stderr
@@ -1,49 +1,49 @@
-error[E0532]: expected tuple struct/variant, found unit struct `Empty2`
+error[E0532]: expected tuple struct or tuple variant, found unit struct `Empty2`
   --> $DIR/empty-struct-unit-pat.rs:21:9
    |
 LL |         Empty2() => ()
    |         ^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6`
 
-error[E0532]: expected tuple struct/variant, found unit struct `XEmpty2`
+error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2`
   --> $DIR/empty-struct-unit-pat.rs:24:9
    |
 LL |         XEmpty2() => ()
    |         ^^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6`
 
-error[E0532]: expected tuple struct/variant, found unit struct `Empty2`
-  --> $DIR/empty-struct-unit-pat.rs:27:9
+error[E0532]: expected tuple struct or tuple variant, found unit struct `Empty2`
+  --> $DIR/empty-struct-unit-pat.rs:28:9
    |
 LL |         Empty2(..) => ()
    |         ^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6`
 
-error[E0532]: expected tuple struct/variant, found unit struct `XEmpty2`
-  --> $DIR/empty-struct-unit-pat.rs:30:9
+error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2`
+  --> $DIR/empty-struct-unit-pat.rs:32:9
    |
 LL |         XEmpty2(..) => ()
    |         ^^^^^^^ help: a tuple struct with a similar name exists: `XEmpty6`
 
-error[E0532]: expected tuple struct/variant, found unit variant `E::Empty4`
-  --> $DIR/empty-struct-unit-pat.rs:34:9
+error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4`
+  --> $DIR/empty-struct-unit-pat.rs:37:9
    |
 LL |         E::Empty4() => ()
-   |         ^^^^^^^^^ not a tuple struct/variant
+   |         ^^^^^^^^^ not a tuple struct or tuple variant
 
-error[E0532]: expected tuple struct/variant, found unit variant `XE::XEmpty4`
-  --> $DIR/empty-struct-unit-pat.rs:37:9
+error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XEmpty4`
+  --> $DIR/empty-struct-unit-pat.rs:41:9
    |
 LL |         XE::XEmpty4() => (),
    |         ^^^^-------
    |             |
    |             help: a tuple variant with a similar name exists: `XEmpty5`
 
-error[E0532]: expected tuple struct/variant, found unit variant `E::Empty4`
-  --> $DIR/empty-struct-unit-pat.rs:42:9
+error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4`
+  --> $DIR/empty-struct-unit-pat.rs:46:9
    |
 LL |         E::Empty4(..) => ()
-   |         ^^^^^^^^^ not a tuple struct/variant
+   |         ^^^^^^^^^ not a tuple struct or tuple variant
 
-error[E0532]: expected tuple struct/variant, found unit variant `XE::XEmpty4`
-  --> $DIR/empty-struct-unit-pat.rs:45:9
+error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XEmpty4`
+  --> $DIR/empty-struct-unit-pat.rs:50:9
    |
 LL |         XE::XEmpty4(..) => (),
    |         ^^^^-------