1
+ //@ check-pass
2
+
1
3
#![ feature( rustc_attrs) ]
2
- #![ pattern_complexity = "10000" ]
4
+ // By default the complexity is 10_000_000, but we reduce it so the test takes
5
+ // (much) less time.
6
+ #![ pattern_complexity = "2000000" ]
3
7
4
8
#[ derive( Default ) ]
5
9
struct BaseCommand {
@@ -21,22 +25,10 @@ struct BaseCommand {
21
25
field16 : bool ,
22
26
field17 : bool ,
23
27
field18 : bool ,
24
- field19 : bool ,
25
- field20 : bool ,
26
- field21 : bool ,
27
- field22 : bool ,
28
- field23 : bool ,
29
- field24 : bool ,
30
- field25 : bool ,
31
- field26 : bool ,
32
- field27 : bool ,
33
- field28 : bool ,
34
- field29 : bool ,
35
- field30 : bool ,
36
28
}
37
29
38
30
fn request_key ( command : BaseCommand ) {
39
- match command { //~ ERROR: reached pattern complexity limit
31
+ match command { //~ WARN: this pattern-match expression is taking a long time to analyze
40
32
BaseCommand { field01 : true , .. } => { }
41
33
BaseCommand { field02 : true , .. } => { }
42
34
BaseCommand { field03 : true , .. } => { }
@@ -55,18 +47,6 @@ fn request_key(command: BaseCommand) {
55
47
BaseCommand { field16 : true , .. } => { }
56
48
BaseCommand { field17 : true , .. } => { }
57
49
BaseCommand { field18 : true , .. } => { }
58
- BaseCommand { field19 : true , .. } => { }
59
- BaseCommand { field20 : true , .. } => { }
60
- BaseCommand { field21 : true , .. } => { }
61
- BaseCommand { field22 : true , .. } => { }
62
- BaseCommand { field23 : true , .. } => { }
63
- BaseCommand { field24 : true , .. } => { }
64
- BaseCommand { field25 : true , .. } => { }
65
- BaseCommand { field26 : true , .. } => { }
66
- BaseCommand { field27 : true , .. } => { }
67
- BaseCommand { field28 : true , .. } => { }
68
- BaseCommand { field29 : true , .. } => { }
69
- BaseCommand { field30 : true , .. } => { }
70
50
71
51
BaseCommand { field01 : false , .. } => { }
72
52
BaseCommand { field02 : false , .. } => { }
@@ -86,18 +66,6 @@ fn request_key(command: BaseCommand) {
86
66
BaseCommand { field16 : false , .. } => { }
87
67
BaseCommand { field17 : false , .. } => { }
88
68
BaseCommand { field18 : false , .. } => { }
89
- BaseCommand { field19 : false , .. } => { }
90
- BaseCommand { field20 : false , .. } => { }
91
- BaseCommand { field21 : false , .. } => { }
92
- BaseCommand { field22 : false , .. } => { }
93
- BaseCommand { field23 : false , .. } => { }
94
- BaseCommand { field24 : false , .. } => { }
95
- BaseCommand { field25 : false , .. } => { }
96
- BaseCommand { field26 : false , .. } => { }
97
- BaseCommand { field27 : false , .. } => { }
98
- BaseCommand { field28 : false , .. } => { }
99
- BaseCommand { field29 : false , .. } => { }
100
- BaseCommand { field30 : false , .. } => { }
101
69
}
102
70
}
103
71
0 commit comments