1+ //@ check-pass
2+
13#![ 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" ]
37
48#[ derive( Default ) ]
59struct BaseCommand {
@@ -21,22 +25,10 @@ struct BaseCommand {
2125 field16 : bool ,
2226 field17 : bool ,
2327 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 ,
3628}
3729
3830fn 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
4032 BaseCommand { field01 : true , .. } => { }
4133 BaseCommand { field02 : true , .. } => { }
4234 BaseCommand { field03 : true , .. } => { }
@@ -55,18 +47,6 @@ fn request_key(command: BaseCommand) {
5547 BaseCommand { field16 : true , .. } => { }
5648 BaseCommand { field17 : true , .. } => { }
5749 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 , .. } => { }
7050
7151 BaseCommand { field01 : false , .. } => { }
7252 BaseCommand { field02 : false , .. } => { }
@@ -86,18 +66,6 @@ fn request_key(command: BaseCommand) {
8666 BaseCommand { field16 : false , .. } => { }
8767 BaseCommand { field17 : false , .. } => { }
8868 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 , .. } => { }
10169 }
10270}
10371
0 commit comments