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