diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2019-11-17 22:43:06 +0000 |
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2019-11-21 11:20:46 +0000 |
| commit | 5510f5589eac9504f7fdbd5673ff64e2bddd88ab (patch) | |
| tree | 52c8cbf097cba33fb5006744b3c2ea9e54982163 /src/test/ui/pattern | |
| parent | fa4a4d3edaf48e9a08f6357765eef8714b424cdf (diff) | |
| download | rust-5510f5589eac9504f7fdbd5673ff64e2bddd88ab.tar.gz rust-5510f5589eac9504f7fdbd5673ff64e2bddd88ab.zip | |
Use appropriate constructor for const slices
Diffstat (limited to 'src/test/ui/pattern')
5 files changed, 9 insertions, 23 deletions
diff --git a/src/test/ui/pattern/usefulness/65413-constants-and-slices-exhaustiveness.rs b/src/test/ui/pattern/usefulness/65413-constants-and-slices-exhaustiveness.rs index cca4173e3ef..6c54c938bf1 100644 --- a/src/test/ui/pattern/usefulness/65413-constants-and-slices-exhaustiveness.rs +++ b/src/test/ui/pattern/usefulness/65413-constants-and-slices-exhaustiveness.rs @@ -1,3 +1,4 @@ +// check-pass #![feature(slice_patterns)] #![deny(unreachable_patterns)] @@ -8,8 +9,7 @@ fn main() { match x { &[] => {} &[1..=255] => {} - // this shouldn't be unreachable - C0 => {} //~ unreachable pattern + C0 => {} &[_, _, ..] => {} } } diff --git a/src/test/ui/pattern/usefulness/65413-constants-and-slices-exhaustiveness.stderr b/src/test/ui/pattern/usefulness/65413-constants-and-slices-exhaustiveness.stderr deleted file mode 100644 index 74421b4085c..00000000000 --- a/src/test/ui/pattern/usefulness/65413-constants-and-slices-exhaustiveness.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: unreachable pattern - --> $DIR/65413-constants-and-slices-exhaustiveness.rs:12:9 - | -LL | C0 => {} - | ^^ - | -note: lint level defined here - --> $DIR/65413-constants-and-slices-exhaustiveness.rs:2:9 - | -LL | #![deny(unreachable_patterns)] - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.stderr b/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.stderr index 63ed49094fc..539aa854f9e 100644 --- a/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.stderr +++ b/src/test/ui/pattern/usefulness/match-byte-array-patterns-2.stderr @@ -1,16 +1,16 @@ -error[E0004]: non-exhaustive patterns: `&[..]` not covered +error[E0004]: non-exhaustive patterns: `&[0u8..=64u8, _, _, _]` and `&[66u8..=std::u8::MAX, _, _, _]` not covered --> $DIR/match-byte-array-patterns-2.rs:4:11 | LL | match buf { - | ^^^ pattern `&[..]` not covered + | ^^^ patterns `&[0u8..=64u8, _, _, _]` and `&[66u8..=std::u8::MAX, _, _, _]` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms -error[E0004]: non-exhaustive patterns: `&[..]` not covered +error[E0004]: non-exhaustive patterns: `&[]`, `&[_]`, `&[_, _]` and 2 more not covered --> $DIR/match-byte-array-patterns-2.rs:10:11 | LL | match buf { - | ^^^ pattern `&[..]` not covered + | ^^^ patterns `&[]`, `&[_]`, `&[_, _]` and 2 more not covered | = 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/slice-patterns-exhaustiveness.rs b/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs index 88a47fc074f..41ba2cc4501 100644 --- a/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs +++ b/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.rs @@ -97,7 +97,7 @@ fn main() { } const CONST1: &[bool; 1] = &[true]; match s1 { - //~^ ERROR `&[..]` not covered + //~^ ERROR `&[false]` not covered CONST1 => {} } match s1 { diff --git a/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr b/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr index 2295de02ed5..8cb342f33df 100644 --- a/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr +++ b/src/test/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr @@ -118,11 +118,11 @@ LL | match s { | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms -error[E0004]: non-exhaustive patterns: `&[..]` not covered +error[E0004]: non-exhaustive patterns: `&[false]` not covered --> $DIR/slice-patterns-exhaustiveness.rs:99:11 | LL | match s1 { - | ^^ pattern `&[..]` not covered + | ^^ pattern `&[false]` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms |
