@@ -26,7 +26,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2626 /// It is a bug to call this with a simplifiable pattern.
2727 pub fn test < ' pat > ( & mut self , match_pair : & MatchPair < ' pat , ' tcx > ) -> Test < ' tcx > {
2828 match * match_pair. pattern . kind {
29- PatternKind :: Variant { ref adt_def, substs : _, variant_index : _, subpatterns : _ } => {
29+ PatKind :: Variant { ref adt_def, substs : _, variant_index : _, subpatterns : _ } => {
3030 Test {
3131 span : match_pair. pattern . span ,
3232 kind : TestKind :: Switch {
@@ -36,7 +36,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
3636 }
3737 }
3838
39- PatternKind :: Constant { .. } if is_switch_ty ( match_pair. pattern . ty ) => {
39+ PatKind :: Constant { .. } if is_switch_ty ( match_pair. pattern . ty ) => {
4040 // For integers, we use a `SwitchInt` match, which allows
4141 // us to handle more cases.
4242 Test {
@@ -52,7 +52,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
5252 }
5353 }
5454
55- PatternKind :: Constant { value } => {
55+ PatKind :: Constant { value } => {
5656 Test {
5757 span : match_pair. pattern . span ,
5858 kind : TestKind :: Eq {
@@ -62,7 +62,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
6262 }
6363 }
6464
65- PatternKind :: Range ( range) => {
65+ PatKind :: Range ( range) => {
6666 assert_eq ! ( range. lo. ty, match_pair. pattern. ty) ;
6767 assert_eq ! ( range. hi. ty, match_pair. pattern. ty) ;
6868 Test {
@@ -71,7 +71,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
7171 }
7272 }
7373
74- PatternKind :: Slice { ref prefix, ref slice, ref suffix } => {
74+ PatKind :: Slice { ref prefix, ref slice, ref suffix } => {
7575 let len = prefix. len ( ) + suffix. len ( ) ;
7676 let op = if slice. is_some ( ) {
7777 BinOp :: Ge
@@ -84,13 +84,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
8484 }
8585 }
8686
87- PatternKind :: AscribeUserType { .. } |
88- PatternKind :: Array { .. } |
89- PatternKind :: Wild |
90- PatternKind :: Or { .. } |
91- PatternKind :: Binding { .. } |
92- PatternKind :: Leaf { .. } |
93- PatternKind :: Deref { .. } => {
87+ PatKind :: AscribeUserType { .. } |
88+ PatKind :: Array { .. } |
89+ PatKind :: Wild |
90+ PatKind :: Or { .. } |
91+ PatKind :: Binding { .. } |
92+ PatKind :: Leaf { .. } |
93+ PatKind :: Deref { .. } => {
9494 self . error_simplifyable ( match_pair)
9595 }
9696 }
@@ -110,7 +110,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
110110 } ;
111111
112112 match * match_pair. pattern . kind {
113- PatternKind :: Constant { value } => {
113+ PatKind :: Constant { value } => {
114114 indices. entry ( value)
115115 . or_insert_with ( || {
116116 options. push ( value. eval_bits (
@@ -120,22 +120,22 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
120120 } ) ;
121121 true
122122 }
123- PatternKind :: Variant { .. } => {
123+ PatKind :: Variant { .. } => {
124124 panic ! ( "you should have called add_variants_to_switch instead!" ) ;
125125 }
126- PatternKind :: Range ( range) => {
126+ PatKind :: Range ( range) => {
127127 // Check that none of the switch values are in the range.
128128 self . values_not_contained_in_range ( range, indices)
129129 . unwrap_or ( false )
130130 }
131- PatternKind :: Slice { .. } |
132- PatternKind :: Array { .. } |
133- PatternKind :: Wild |
134- PatternKind :: Or { .. } |
135- PatternKind :: Binding { .. } |
136- PatternKind :: AscribeUserType { .. } |
137- PatternKind :: Leaf { .. } |
138- PatternKind :: Deref { .. } => {
131+ PatKind :: Slice { .. } |
132+ PatKind :: Array { .. } |
133+ PatKind :: Wild |
134+ PatKind :: Or { .. } |
135+ PatKind :: Binding { .. } |
136+ PatKind :: AscribeUserType { .. } |
137+ PatKind :: Leaf { .. } |
138+ PatKind :: Deref { .. } => {
139139 // don't know how to add these patterns to a switch
140140 false
141141 }
@@ -154,7 +154,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
154154 } ;
155155
156156 match * match_pair. pattern . kind {
157- PatternKind :: Variant { adt_def : _ , variant_index, .. } => {
157+ PatKind :: Variant { adt_def : _ , variant_index, .. } => {
158158 // We have a pattern testing for variant `variant_index`
159159 // set the corresponding index to true
160160 variants. insert ( variant_index) ;
@@ -533,7 +533,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
533533 // If we are performing a variant switch, then this
534534 // informs variant patterns, but nothing else.
535535 ( & TestKind :: Switch { adt_def : tested_adt_def, .. } ,
536- & PatternKind :: Variant { adt_def, variant_index, ref subpatterns, .. } ) => {
536+ & PatKind :: Variant { adt_def, variant_index, ref subpatterns, .. } ) => {
537537 assert_eq ! ( adt_def, tested_adt_def) ;
538538 self . candidate_after_variant_switch ( match_pair_index,
539539 adt_def,
@@ -548,18 +548,18 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
548548 // If we are performing a switch over integers, then this informs integer
549549 // equality, but nothing else.
550550 //
551- // FIXME(#29623) we could use PatternKind ::Range to rule
551+ // FIXME(#29623) we could use PatKind ::Range to rule
552552 // things out here, in some cases.
553553 ( & TestKind :: SwitchInt { switch_ty : _, options : _, ref indices } ,
554- & PatternKind :: Constant { ref value } )
554+ & PatKind :: Constant { ref value } )
555555 if is_switch_ty ( match_pair. pattern . ty ) => {
556556 let index = indices[ value] ;
557557 self . candidate_without_match_pair ( match_pair_index, candidate) ;
558558 Some ( index)
559559 }
560560
561561 ( & TestKind :: SwitchInt { switch_ty : _, ref options, ref indices } ,
562- & PatternKind :: Range ( range) ) => {
562+ & PatKind :: Range ( range) ) => {
563563 let not_contained = self
564564 . values_not_contained_in_range ( range, indices)
565565 . unwrap_or ( false ) ;
@@ -577,7 +577,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
577577 ( & TestKind :: SwitchInt { .. } , _) => None ,
578578
579579 ( & TestKind :: Len { len : test_len, op : BinOp :: Eq } ,
580- & PatternKind :: Slice { ref prefix, ref slice, ref suffix } ) => {
580+ & PatKind :: Slice { ref prefix, ref slice, ref suffix } ) => {
581581 let pat_len = ( prefix. len ( ) + suffix. len ( ) ) as u64 ;
582582 match ( test_len. cmp ( & pat_len) , slice) {
583583 ( Ordering :: Equal , & None ) => {
@@ -610,7 +610,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
610610 }
611611
612612 ( & TestKind :: Len { len : test_len, op : BinOp :: Ge } ,
613- & PatternKind :: Slice { ref prefix, ref slice, ref suffix } ) => {
613+ & PatKind :: Slice { ref prefix, ref slice, ref suffix } ) => {
614614 // the test is `$actual_len >= test_len`
615615 let pat_len = ( prefix. len ( ) + suffix. len ( ) ) as u64 ;
616616 match ( test_len. cmp ( & pat_len) , slice) {
@@ -644,7 +644,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
644644 }
645645
646646 ( & TestKind :: Range ( test) ,
647- & PatternKind :: Range ( pat) ) => {
647+ & PatKind :: Range ( pat) ) => {
648648 if test == pat {
649649 self . candidate_without_match_pair (
650650 match_pair_index,
@@ -683,7 +683,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
683683 }
684684 }
685685
686- ( & TestKind :: Range ( range) , & PatternKind :: Constant { value } ) => {
686+ ( & TestKind :: Range ( range) , & PatKind :: Constant { value } ) => {
687687 if self . const_range_contains ( range, value) == Some ( false ) {
688688 // `value` is not contained in the testing range,
689689 // so `value` can be matched only if this test fails.
0 commit comments