about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeSeulArtichaut <leseulartichaut@gmail.com>2020-01-02 21:08:25 +0100
committerLeSeulArtichaut <leseulartichaut@gmail.com>2020-01-02 21:08:25 +0100
commitdc19b4842a2842916bca601b83abfdf1f5ae4395 (patch)
tree246bf5a6427bd91507f1dcd0256a94a68d0dc7bc
parent318280519d7a721e36d9508ab185e85bde21e2f5 (diff)
downloadrust-dc19b4842a2842916bca601b83abfdf1f5ae4395.tar.gz
rust-dc19b4842a2842916bca601b83abfdf1f5ae4395.zip
Enhance test
Co-authored-by: Centril <twingoow@gmail.com>
-rw-r--r--src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs21
-rw-r--r--src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr28
2 files changed, 35 insertions, 14 deletions
diff --git a/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs b/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs
index d106bf71341..5e6a97b3ff7 100644
--- a/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs
+++ b/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs
@@ -12,20 +12,29 @@ enum Foo {
 }
 
 
-fn fn2(e: Foo) {
+fn fn1(e: Foo) {
     match e {
-        Bar => println!("A"),
+        Bar => {},
         //~^ WARNING named the same as one of the variants of the type `Foo`
-        Baz => println!("B"),
+        Baz => {},
         //~^ WARNING named the same as one of the variants of the type `Foo`
     }
 }
 
-fn fn1(e: &Foo) {
+fn fn2(e: &Foo) {
     match e {
-        Bar => println!("A"),
+        Bar => {},
         //~^ WARNING named the same as one of the variants of the type `Foo`
-        Baz => println!("B"),
+        Baz => {},
+        //~^ WARNING named the same as one of the variants of the type `Foo`
+    }
+}
+
+fn fn3(e: &mut &&mut Foo) {
+    match e {
+        Bar => {},
+        //~^ WARNING named the same as one of the variants of the type `Foo`
+        Baz => {},
         //~^ WARNING named the same as one of the variants of the type `Foo`
     }
 }
diff --git a/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr b/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr
index cadf5e6cdee..abb8d6907e7 100644
--- a/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr
+++ b/src/test/ui/pattern/issue-67776-match-same-name-enum-variant-refs.stderr
@@ -1,24 +1,36 @@
 warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
-  --> $DIR/match-same-name-enum-variant.rs:14:9
+  --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:17:9
    |
-LL |         Bar => println!("A"),
+LL |         Bar => {},
    |         ^^^ help: to match on the variant, qualify the path: `Foo::Bar`
 
 warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
-  --> $DIR/match-same-name-enum-variant.rs:16:9
+  --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:19:9
    |
-LL |         Baz => println!("B"),
+LL |         Baz => {},
    |         ^^^ help: to match on the variant, qualify the path: `Foo::Baz`
 
 warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
-  --> $DIR/match-same-name-enum-variant.rs:23:9
+  --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:26:9
    |
-LL |         Bar => println!("A"),
+LL |         Bar => {},
    |         ^^^ help: to match on the variant, qualify the path: `Foo::Bar`
 
 warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
-  --> $DIR/match-same-name-enum-variant.rs:25:9
+  --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:28:9
    |
-LL |         Baz => println!("B"),
+LL |         Baz => {},
+   |         ^^^ help: to match on the variant, qualify the path: `Foo::Baz`
+
+warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo`
+  --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:35:9
+   |
+LL |         Bar => {},
+   |         ^^^ help: to match on the variant, qualify the path: `Foo::Bar`
+
+warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo`
+  --> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:37:9
+   |
+LL |         Baz => {},
    |         ^^^ help: to match on the variant, qualify the path: `Foo::Baz`