2024-02-08 04:27:46 -06:00
|
|
|
//@ revisions: min_exhaustive_patterns exhaustive_patterns
|
|
|
|
#![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
|
|
|
|
#![cfg_attr(min_exhaustive_patterns, feature(min_exhaustive_patterns))]
|
2023-10-04 17:58:14 -05:00
|
|
|
#![feature(never_type)]
|
|
|
|
#![deny(unreachable_patterns)]
|
|
|
|
|
|
|
|
fn main() {}
|
|
|
|
|
|
|
|
fn foo(nevers: &[!]) {
|
|
|
|
match nevers {
|
2024-02-08 04:27:46 -06:00
|
|
|
//[min_exhaustive_patterns]~^ ERROR non-exhaustive patterns: `&[_, ..]` not covered
|
2023-10-04 17:58:14 -05:00
|
|
|
&[] => (),
|
|
|
|
};
|
|
|
|
|
|
|
|
match nevers {
|
|
|
|
&[] => (),
|
2023-11-18 14:39:57 -06:00
|
|
|
&[_] => (),
|
|
|
|
&[_, _, ..] => (),
|
2023-10-04 17:58:14 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
match nevers {
|
2024-02-08 04:27:46 -06:00
|
|
|
//[exhaustive_patterns]~^ ERROR non-exhaustive patterns: `&[]` not covered
|
|
|
|
//[min_exhaustive_patterns]~^^ ERROR non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
|
2023-11-18 14:39:57 -06:00
|
|
|
&[_] => (),
|
2023-10-04 17:58:14 -05:00
|
|
|
};
|
|
|
|
}
|