@@ -56,13 +56,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
56
56
( ( prefix. len ( ) + suffix. len ( ) ) . try_into ( ) . unwrap ( ) , false )
57
57
} ;
58
58
59
- if self . subslice_work_optimizing ( prefix) {
59
+ if self . subslice_work_optimizing ( prefix) && opt_slice . is_none ( ) && suffix . is_empty ( ) {
60
60
let elem_ty = prefix[ 0 ] . ty ;
61
61
let prefix_valtree = self . simplify_const_pattern_slice_into_valtree ( prefix) ;
62
62
63
63
let project = PlaceElem :: Subslice {
64
64
from : 0 as u64 ,
65
- to : prefix. len ( ) as u64 ,
65
+ to : prefix. len ( ) as u64 , // TODO: look at this
66
66
from_end : !exact_size,
67
67
} ;
68
68
@@ -81,7 +81,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
81
81
let elem = ProjectionElem :: ConstantIndex {
82
82
offset : idx as u64 ,
83
83
min_length,
84
- from_end : !exact_size ,
84
+ from_end : false ,
85
85
} ;
86
86
MatchPairTree :: for_pattern ( place. clone_project ( elem) , subpattern, self )
87
87
} ) ) ;
@@ -91,7 +91,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
91
91
let suffix_len = suffix. len ( ) as u64 ;
92
92
let subslice = place. clone_project ( PlaceElem :: Subslice {
93
93
from : prefix. len ( ) as u64 ,
94
- to : if exact_size { min_length - suffix_len } else { suffix_len } ,
94
+ to : if exact_size { min_length - suffix_len } else { suffix_len } , // TODO: look at this
95
95
from_end : !exact_size,
96
96
} ) ;
97
97
match_pairs. push ( MatchPairTree :: for_pattern ( subslice, subslice_pat, self ) ) ;
0 commit comments