about summary refs log tree commit diff
path: root/src/test/ui/pattern/usefulness
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2019-12-03 19:04:01 +0000
committerNadrieril <nadrieril+git@gmail.com>2019-12-04 16:43:24 +0000
commit40f434b8c5a0bbea8e87aeb2bc3a81b99fcb7a64 (patch)
tree2843ad4fa78cfb006b0fb7c16f740a4715d4d82e /src/test/ui/pattern/usefulness
parentd289f55b0c8e4b97a85d18109183b73e78f67db6 (diff)
downloadrust-40f434b8c5a0bbea8e87aeb2bc3a81b99fcb7a64.tar.gz
rust-40f434b8c5a0bbea8e87aeb2bc3a81b99fcb7a64.zip
Reuse `adt_defined_here`
Diffstat (limited to 'src/test/ui/pattern/usefulness')
-rw-r--r--src/test/ui/pattern/usefulness/always-inhabited-union-ref.stderr9
-rw-r--r--src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.stderr22
-rw-r--r--src/test/ui/pattern/usefulness/match-empty.stderr22
3 files changed, 43 insertions, 10 deletions
diff --git a/src/test/ui/pattern/usefulness/always-inhabited-union-ref.stderr b/src/test/ui/pattern/usefulness/always-inhabited-union-ref.stderr
index 792ab6f59a4..1b1096c977a 100644
--- a/src/test/ui/pattern/usefulness/always-inhabited-union-ref.stderr
+++ b/src/test/ui/pattern/usefulness/always-inhabited-union-ref.stderr
@@ -9,8 +9,13 @@ LL |     match uninhab_ref() {
 error[E0004]: non-exhaustive patterns: type `Foo` is non-empty
   --> $DIR/always-inhabited-union-ref.rs:27:11
    |
-LL |     match uninhab_union() {
-   |           ^^^^^^^^^^^^^^^
+LL | / pub union Foo {
+LL | |     foo: !,
+LL | | }
+   | |_- `Foo` defined here
+...
+LL |       match uninhab_union() {
+   |             ^^^^^^^^^^^^^^^
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
 
diff --git a/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.stderr b/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.stderr
index f8e34137307..b125718ae2c 100644
--- a/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.stderr
+++ b/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.stderr
@@ -39,6 +39,9 @@ LL |     match_empty!(0u8);
 error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
   --> $DIR/match-empty-exhaustive_patterns.rs:66:18
    |
+LL | struct NonEmptyStruct(bool);
+   | ---------------------------- `NonEmptyStruct` defined here
+...
 LL |     match_empty!(NonEmptyStruct(true));
    |                  ^^^^^^^^^^^^^^^^^^^^
    |
@@ -47,16 +50,27 @@ LL |     match_empty!(NonEmptyStruct(true));
 error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
   --> $DIR/match-empty-exhaustive_patterns.rs:68:18
    |
-LL |     match_empty!((NonEmptyUnion1 { foo: () }));
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | / union NonEmptyUnion1 {
+LL | |     foo: (),
+LL | | }
+   | |_- `NonEmptyUnion1` defined here
+...
+LL |       match_empty!((NonEmptyUnion1 { foo: () }));
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
 
 error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
   --> $DIR/match-empty-exhaustive_patterns.rs:70:18
    |
-LL |     match_empty!((NonEmptyUnion2 { foo: () }));
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | / union NonEmptyUnion2 {
+LL | |     foo: (),
+LL | |     bar: (),
+LL | | }
+   | |_- `NonEmptyUnion2` defined here
+...
+LL |       match_empty!((NonEmptyUnion2 { foo: () }));
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
 
diff --git a/src/test/ui/pattern/usefulness/match-empty.stderr b/src/test/ui/pattern/usefulness/match-empty.stderr
index 91e934307a4..a4e143b6782 100644
--- a/src/test/ui/pattern/usefulness/match-empty.stderr
+++ b/src/test/ui/pattern/usefulness/match-empty.stderr
@@ -20,6 +20,9 @@ LL |     match_empty!(0u8);
 error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
   --> $DIR/match-empty.rs:65:18
    |
+LL | struct NonEmptyStruct(bool);
+   | ---------------------------- `NonEmptyStruct` defined here
+...
 LL |     match_empty!(NonEmptyStruct(true));
    |                  ^^^^^^^^^^^^^^^^^^^^
    |
@@ -28,16 +31,27 @@ LL |     match_empty!(NonEmptyStruct(true));
 error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
   --> $DIR/match-empty.rs:67:18
    |
-LL |     match_empty!((NonEmptyUnion1 { foo: () }));
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | / union NonEmptyUnion1 {
+LL | |     foo: (),
+LL | | }
+   | |_- `NonEmptyUnion1` defined here
+...
+LL |       match_empty!((NonEmptyUnion1 { foo: () }));
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
 
 error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
   --> $DIR/match-empty.rs:69:18
    |
-LL |     match_empty!((NonEmptyUnion2 { foo: () }));
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | / union NonEmptyUnion2 {
+LL | |     foo: (),
+LL | |     bar: (),
+LL | | }
+   | |_- `NonEmptyUnion2` defined here
+...
+LL |       match_empty!((NonEmptyUnion2 { foo: () }));
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms