about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Wright <mikerite@lavabit.com>2019-09-22 09:10:39 +0200
committerMichael Wright <mikerite@lavabit.com>2019-09-22 09:10:39 +0200
commitbe4e41562a7f1a14783fecff8dd904fd28d1f82f (patch)
tree998d6409fb8fff76fbae644b2298b4046e5d54d8
parentd04bf1511411121cdff4688544dd4d6afa53f7ae (diff)
downloadrust-be4e41562a7f1a14783fecff8dd904fd28d1f82f.tar.gz
rust-be4e41562a7f1a14783fecff8dd904fd28d1f82f.zip
Add additional tests to unneeded_wildcard_pattern
-rw-r--r--tests/ui/unneeded_wildcard_pattern.fixed4
-rw-r--r--tests/ui/unneeded_wildcard_pattern.rs4
-rw-r--r--tests/ui/unneeded_wildcard_pattern.stderr42
3 files changed, 41 insertions, 9 deletions
diff --git a/tests/ui/unneeded_wildcard_pattern.fixed b/tests/ui/unneeded_wildcard_pattern.fixed
index d0b62fa6f43..12c3461c955 100644
--- a/tests/ui/unneeded_wildcard_pattern.fixed
+++ b/tests/ui/unneeded_wildcard_pattern.fixed
@@ -7,6 +7,8 @@ fn main() {
 
     if let (0, ..) = t {};
     if let (0, ..) = t {};
+    if let (.., 0) = t {};
+    if let (.., 0) = t {};
     if let (0, ..) = t {};
     if let (0, ..) = t {};
     if let (_, 0, ..) = t {};
@@ -26,6 +28,8 @@ fn main() {
 
     if let S(0, ..) = s {};
     if let S(0, ..) = s {};
+    if let S(.., 0) = s {};
+    if let S(.., 0) = s {};
     if let S(0, ..) = s {};
     if let S(0, ..) = s {};
     if let S(_, 0, ..) = s {};
diff --git a/tests/ui/unneeded_wildcard_pattern.rs b/tests/ui/unneeded_wildcard_pattern.rs
index bad158907ba..4ac01d5d23b 100644
--- a/tests/ui/unneeded_wildcard_pattern.rs
+++ b/tests/ui/unneeded_wildcard_pattern.rs
@@ -7,6 +7,8 @@ fn main() {
 
     if let (0, .., _) = t {};
     if let (0, _, ..) = t {};
+    if let (_, .., 0) = t {};
+    if let (.., _, 0) = t {};
     if let (0, _, _, ..) = t {};
     if let (0, .., _, _) = t {};
     if let (_, 0, ..) = t {};
@@ -26,6 +28,8 @@ fn main() {
 
     if let S(0, .., _) = s {};
     if let S(0, _, ..) = s {};
+    if let S(_, .., 0) = s {};
+    if let S(.., _, 0) = s {};
     if let S(0, _, _, ..) = s {};
     if let S(0, .., _, _) = s {};
     if let S(_, 0, ..) = s {};
diff --git a/tests/ui/unneeded_wildcard_pattern.stderr b/tests/ui/unneeded_wildcard_pattern.stderr
index 8cc2516959a..25251cf36c0 100644
--- a/tests/ui/unneeded_wildcard_pattern.stderr
+++ b/tests/ui/unneeded_wildcard_pattern.stderr
@@ -16,53 +16,77 @@ error: this pattern is unneeded as the `..` pattern can match that element
 LL |     if let (0, _, ..) = t {};
    |                ^^^ help: remove it
 
+error: this pattern is unneeded as the `..` pattern can match that element
+  --> $DIR/unneeded_wildcard_pattern.rs:10:13
+   |
+LL |     if let (_, .., 0) = t {};
+   |             ^^^ help: remove it
+
+error: this pattern is unneeded as the `..` pattern can match that element
+  --> $DIR/unneeded_wildcard_pattern.rs:11:15
+   |
+LL |     if let (.., _, 0) = t {};
+   |               ^^^ help: remove it
+
 error: these patterns are unneeded as the `..` pattern can match those elements
-  --> $DIR/unneeded_wildcard_pattern.rs:10:16
+  --> $DIR/unneeded_wildcard_pattern.rs:12:16
    |
 LL |     if let (0, _, _, ..) = t {};
    |                ^^^^^^ help: remove them
 
 error: these patterns are unneeded as the `..` pattern can match those elements
-  --> $DIR/unneeded_wildcard_pattern.rs:11:18
+  --> $DIR/unneeded_wildcard_pattern.rs:13:18
    |
 LL |     if let (0, .., _, _) = t {};
    |                  ^^^^^^ help: remove them
 
 error: these patterns are unneeded as the `..` pattern can match those elements
-  --> $DIR/unneeded_wildcard_pattern.rs:20:22
+  --> $DIR/unneeded_wildcard_pattern.rs:22:22
    |
 LL |         if let (0, .., _, _,) = t {};
    |                      ^^^^^^ help: remove them
 
 error: this pattern is unneeded as the `..` pattern can match that element
-  --> $DIR/unneeded_wildcard_pattern.rs:27:19
+  --> $DIR/unneeded_wildcard_pattern.rs:29:19
    |
 LL |     if let S(0, .., _) = s {};
    |                   ^^^ help: remove it
 
 error: this pattern is unneeded as the `..` pattern can match that element
-  --> $DIR/unneeded_wildcard_pattern.rs:28:17
+  --> $DIR/unneeded_wildcard_pattern.rs:30:17
    |
 LL |     if let S(0, _, ..) = s {};
    |                 ^^^ help: remove it
 
+error: this pattern is unneeded as the `..` pattern can match that element
+  --> $DIR/unneeded_wildcard_pattern.rs:31:14
+   |
+LL |     if let S(_, .., 0) = s {};
+   |              ^^^ help: remove it
+
+error: this pattern is unneeded as the `..` pattern can match that element
+  --> $DIR/unneeded_wildcard_pattern.rs:32:16
+   |
+LL |     if let S(.., _, 0) = s {};
+   |                ^^^ help: remove it
+
 error: these patterns are unneeded as the `..` pattern can match those elements
-  --> $DIR/unneeded_wildcard_pattern.rs:29:17
+  --> $DIR/unneeded_wildcard_pattern.rs:33:17
    |
 LL |     if let S(0, _, _, ..) = s {};
    |                 ^^^^^^ help: remove them
 
 error: these patterns are unneeded as the `..` pattern can match those elements
-  --> $DIR/unneeded_wildcard_pattern.rs:30:19
+  --> $DIR/unneeded_wildcard_pattern.rs:34:19
    |
 LL |     if let S(0, .., _, _) = s {};
    |                   ^^^^^^ help: remove them
 
 error: these patterns are unneeded as the `..` pattern can match those elements
-  --> $DIR/unneeded_wildcard_pattern.rs:39:23
+  --> $DIR/unneeded_wildcard_pattern.rs:43:23
    |
 LL |         if let S(0, .., _, _,) = s {};
    |                       ^^^^^^ help: remove them
 
-error: aborting due to 10 previous errors
+error: aborting due to 14 previous errors