]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.rs
Rollup merge of #89793 - ibraheemdev:from_ptr_range, r=m-ou-se
[rust.git] / src / test / ui / feature-gates / feature-gate-non_exhaustive_omitted_patterns_lint.rs
1 #![deny(non_exhaustive_omitted_patterns)]
2 //~^ ERROR the `non_exhaustive_omitted_patterns` lint is unstable
3 //~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable
4 #![allow(non_exhaustive_omitted_patterns)]
5 //~^ ERROR the `non_exhaustive_omitted_patterns` lint is unstable
6 //~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable
7
8 fn main() {
9     enum Foo {
10         A, B, C,
11     }
12
13     #[allow(non_exhaustive_omitted_patterns)]
14     match Foo::A {
15         Foo::A => {}
16         Foo::B => {}
17     }
18     //~^^^^^ ERROR the `non_exhaustive_omitted_patterns` lint is unstable
19     //~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable
20     //~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable
21     //~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable
22
23     match Foo::A {
24         Foo::A => {}
25         Foo::B => {}
26         #[warn(non_exhaustive_omitted_patterns)]
27         _ => {}
28     }
29     //~^^^ ERROR the `non_exhaustive_omitted_patterns` lint is unstable
30     //~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable
31 }