diff options
| author | Nadrieril <nadrieril@gmail.com> | 2019-09-28 16:05:38 +0200 |
|---|---|---|
| committer | Nadrieril <nadrieril@gmail.com> | 2019-10-27 21:20:26 +0000 |
| commit | 09f9947ebc68a8199c3dff8607a41571c48cc377 (patch) | |
| tree | fb81c258de9902ea813c24c5ca08bcce9817a4bb /src/test/ui/structs | |
| parent | 0f677c65e867d93a47ccbaeaf6e6725cde8c5ff6 (diff) | |
| download | rust-09f9947ebc68a8199c3dff8607a41571c48cc377.tar.gz rust-09f9947ebc68a8199c3dff8607a41571c48cc377.zip | |
Gather together usefulness tests
I took most tests that were testing only for match exhaustiveness, pattern refutability or match arm reachability, and put them in the same test folder.
Diffstat (limited to 'src/test/ui/structs')
4 files changed, 0 insertions, 59 deletions
diff --git a/src/test/ui/structs/struct-like-enum-nonexhaustive.rs b/src/test/ui/structs/struct-like-enum-nonexhaustive.rs deleted file mode 100644 index b1fc0f5ad3e..00000000000 --- a/src/test/ui/structs/struct-like-enum-nonexhaustive.rs +++ /dev/null @@ -1,12 +0,0 @@ -enum A { - B { x: Option<isize> }, - C -} - -fn main() { - let x = A::B { x: Some(3) }; - match x { //~ ERROR non-exhaustive patterns - A::C => {} - A::B { x: None } => {} - } -} diff --git a/src/test/ui/structs/struct-like-enum-nonexhaustive.stderr b/src/test/ui/structs/struct-like-enum-nonexhaustive.stderr deleted file mode 100644 index d6b5af17964..00000000000 --- a/src/test/ui/structs/struct-like-enum-nonexhaustive.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0004]: non-exhaustive patterns: `B { x: Some(_) }` not covered - --> $DIR/struct-like-enum-nonexhaustive.rs:8:11 - | -LL | / enum A { -LL | | B { x: Option<isize> }, - | | - not covered -LL | | C -LL | | } - | |_- `A` defined here -... -LL | match x { - | ^ pattern `B { x: Some(_) }` not covered - | - = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/ui/structs/struct-pattern-match-useless.rs b/src/test/ui/structs/struct-pattern-match-useless.rs deleted file mode 100644 index 93f0a931761..00000000000 --- a/src/test/ui/structs/struct-pattern-match-useless.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![deny(unreachable_patterns)] - -struct Foo { - x: isize, - y: isize, -} - -pub fn main() { - let a = Foo { x: 1, y: 2 }; - match a { - Foo { x: _x, y: _y } => (), - Foo { .. } => () //~ ERROR unreachable pattern - } - -} diff --git a/src/test/ui/structs/struct-pattern-match-useless.stderr b/src/test/ui/structs/struct-pattern-match-useless.stderr deleted file mode 100644 index 5b0c9305448..00000000000 --- a/src/test/ui/structs/struct-pattern-match-useless.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: unreachable pattern - --> $DIR/struct-pattern-match-useless.rs:12:9 - | -LL | Foo { .. } => () - | ^^^^^^^^^^ - | -note: lint level defined here - --> $DIR/struct-pattern-match-useless.rs:1:9 - | -LL | #![deny(unreachable_patterns)] - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - |
