1 #![allow(dead_code)]
2 #![cfg(not(remain_stable_testing))]
3 #![feature(proc_macro_hygiene, stmt_expr_attributes)]
4
5 #[remain::sorted]
6 #[derive(PartialEq)]
7 pub enum TestEnum {
8 A,
9 #[remain::unsorted]
10 Ignored,
11 B,
12 C,
13 D,
14 __Nonexhaustive,
15 }
16
17 #[remain::sorted]
18 #[derive(PartialEq)]
19 pub struct TestStruct {
20 a: usize,
21 b: usize,
22 c: usize,
23 #[unsorted]
24 ignored: usize,
25 d: usize,
26 }
27
28 #[test]
test_attrs()29 fn test_attrs() {
30 fn is_partial_eq<T: PartialEq>() -> bool {
31 true
32 }
33
34 assert!(is_partial_eq::<TestEnum>());
35 assert!(is_partial_eq::<TestStruct>());
36 }
37
38 #[test]
test_let()39 fn test_let() {
40 let value = TestEnum::A;
41
42 #[remain::sorted]
43 let _ = match value {
44 TestEnum::A => {}
45 #[remain::unsorted]
46 TestEnum::Ignored => {}
47 TestEnum::B => {}
48 TestEnum::C => {}
49 _ => {}
50 };
51 }
52
53 #[test]
test_match()54 fn test_match() {
55 let value = TestEnum::A;
56
57 #[remain::sorted]
58 match value {
59 TestEnum::A => {}
60 TestEnum::B => {}
61 #[unsorted]
62 TestEnum::Ignored => {}
63 TestEnum::C => {}
64 _ => {}
65 }
66 }
67