2019-09-23 13:41:38 -05:00
|
|
|
fn main() {
|
|
|
|
let s: &[bool] = &[true; 0];
|
|
|
|
let s1: &[bool; 1] = &[false; 1];
|
|
|
|
let s2: &[bool; 2] = &[false; 2];
|
|
|
|
let s3: &[bool; 3] = &[false; 3];
|
2019-11-16 10:18:46 -06:00
|
|
|
let s10: &[bool; 10] = &[false; 10];
|
|
|
|
|
|
|
|
match s2 {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[false, _]` not covered
|
2019-11-16 10:18:46 -06:00
|
|
|
[true, .., true] => {}
|
|
|
|
}
|
|
|
|
match s3 {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[false, ..]` not covered
|
2019-11-16 10:18:46 -06:00
|
|
|
[true, .., true] => {}
|
|
|
|
}
|
|
|
|
match s10 {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[false, ..]` not covered
|
2019-11-16 10:18:46 -06:00
|
|
|
[true, .., true] => {}
|
|
|
|
}
|
2019-09-23 13:41:38 -05:00
|
|
|
|
|
|
|
match s1 {
|
|
|
|
[true, ..] => {}
|
|
|
|
[.., false] => {}
|
|
|
|
}
|
|
|
|
match s2 {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[false, true]` not covered
|
2019-09-23 13:41:38 -05:00
|
|
|
[true, ..] => {}
|
|
|
|
[.., false] => {}
|
|
|
|
}
|
|
|
|
match s3 {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[false, .., true]` not covered
|
2019-09-23 13:41:38 -05:00
|
|
|
[true, ..] => {}
|
|
|
|
[.., false] => {}
|
|
|
|
}
|
|
|
|
match s {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[false, .., true]` not covered
|
2019-09-23 13:41:38 -05:00
|
|
|
[] => {}
|
|
|
|
[true, ..] => {}
|
|
|
|
[.., false] => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
match s {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[_, ..]` not covered
|
2019-09-23 13:41:38 -05:00
|
|
|
[] => {}
|
|
|
|
}
|
|
|
|
match s {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[_, _, ..]` not covered
|
2019-09-23 13:41:38 -05:00
|
|
|
[] => {}
|
|
|
|
[_] => {}
|
|
|
|
}
|
|
|
|
match s {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[false, ..]` not covered
|
2019-09-23 13:41:38 -05:00
|
|
|
[] => {}
|
|
|
|
[true, ..] => {}
|
|
|
|
}
|
|
|
|
match s {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[false, _, ..]` not covered
|
2019-09-23 13:41:38 -05:00
|
|
|
[] => {}
|
|
|
|
[_] => {}
|
|
|
|
[true, ..] => {}
|
|
|
|
}
|
|
|
|
match s {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[_, .., false]` not covered
|
2019-09-23 13:41:38 -05:00
|
|
|
[] => {}
|
|
|
|
[_] => {}
|
|
|
|
[.., true] => {}
|
|
|
|
}
|
|
|
|
|
2019-10-05 16:57:52 -05:00
|
|
|
match s {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[_, _, .., true]` not covered
|
2019-10-05 16:57:52 -05:00
|
|
|
[] => {}
|
|
|
|
[_] => {}
|
|
|
|
[_, _] => {}
|
|
|
|
[.., false] => {}
|
|
|
|
}
|
|
|
|
match s {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[true, _, .., _]` not covered
|
2019-10-05 16:57:52 -05:00
|
|
|
[] => {}
|
|
|
|
[_] => {}
|
|
|
|
[_, _] => {}
|
|
|
|
[false, .., false] => {}
|
|
|
|
}
|
2019-11-17 16:25:51 -06:00
|
|
|
|
|
|
|
const CONST: &[bool] = &[true];
|
|
|
|
match s {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[]` and `&[_, _, ..]` not covered
|
|
|
|
&[true] => {}
|
|
|
|
}
|
|
|
|
match s {
|
|
|
|
//~^ ERROR `&[]` and `&[_, _, ..]` not covered
|
|
|
|
CONST => {}
|
|
|
|
}
|
|
|
|
match s {
|
|
|
|
//~^ ERROR `&[]` and `&[_, _, ..]` not covered
|
2019-11-17 16:25:51 -06:00
|
|
|
CONST => {}
|
2020-07-01 08:10:51 -05:00
|
|
|
&[false] => {}
|
2019-11-17 16:25:51 -06:00
|
|
|
}
|
|
|
|
match s {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[]` and `&[_, _, ..]` not covered
|
|
|
|
&[false] => {}
|
|
|
|
CONST => {}
|
|
|
|
}
|
|
|
|
match s {
|
|
|
|
//~^ ERROR `&[_, _, ..]` not covered
|
|
|
|
&[] => {}
|
|
|
|
CONST => {}
|
|
|
|
}
|
|
|
|
match s {
|
|
|
|
//~^ ERROR `&[false]` not covered
|
|
|
|
&[] => {}
|
|
|
|
CONST => {}
|
|
|
|
&[_, _, ..] => {}
|
|
|
|
}
|
|
|
|
match s {
|
|
|
|
[] => {}
|
|
|
|
[false] => {}
|
|
|
|
CONST => {}
|
2019-11-17 16:25:51 -06:00
|
|
|
[_, _, ..] => {}
|
|
|
|
}
|
|
|
|
const CONST1: &[bool; 1] = &[true];
|
|
|
|
match s1 {
|
2020-07-01 08:10:51 -05:00
|
|
|
//~^ ERROR `&[false]` not covered
|
2019-11-17 16:25:51 -06:00
|
|
|
CONST1 => {}
|
|
|
|
}
|
|
|
|
match s1 {
|
|
|
|
CONST1 => {}
|
|
|
|
[false] => {}
|
|
|
|
}
|
2019-09-23 13:41:38 -05:00
|
|
|
}
|