Add some test cases
This commit is contained in:
parent
65bc67e8d9
commit
58de9d9a13
@ -93,4 +93,18 @@ fn main() {
|
||||
[false] => {}
|
||||
[..] => {}
|
||||
}
|
||||
match s {
|
||||
//~^ ERROR `&[_, _, true]` not covered
|
||||
[] => {}
|
||||
[_] => {}
|
||||
[_, _] => {}
|
||||
[.., false] => {}
|
||||
}
|
||||
match s {
|
||||
//~^ ERROR `&[true, _, _]` not covered
|
||||
[] => {}
|
||||
[_] => {}
|
||||
[_, _] => {}
|
||||
[false, .., false] => {}
|
||||
}
|
||||
}
|
||||
|
@ -112,6 +112,22 @@ error: unreachable pattern
|
||||
LL | [false, true] => {}
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 15 previous errors
|
||||
error[E0004]: non-exhaustive patterns: `&[_, _, true]` not covered
|
||||
--> $DIR/slice-patterns.rs:96:11
|
||||
|
|
||||
LL | match s {
|
||||
| ^ pattern `&[_, _, true]` not covered
|
||||
|
|
||||
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
||||
|
||||
error[E0004]: non-exhaustive patterns: `&[true, _, _]` not covered
|
||||
--> $DIR/slice-patterns.rs:103:11
|
||||
|
|
||||
LL | match s {
|
||||
| ^ pattern `&[true, _, _]` not covered
|
||||
|
|
||||
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
|
||||
|
||||
error: aborting due to 17 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0004`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user