@@ -129,7 +129,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
129
129
& mut self ,
130
130
base_pat : & ' pat Pat < ' tcx > ,
131
131
match_pairs : & mut Vec < MatchPairTree < ' pat , ' tcx > > ,
132
- place : & PlaceBuilder < ' tcx > ,
132
+ place : PlaceBuilder < ' tcx > ,
133
133
prefix : & ' pat [ Box < Pat < ' tcx > > ] ,
134
134
opt_slice : & ' pat Option < Box < Pat < ' tcx > > > ,
135
135
suffix : & ' pat [ Box < Pat < ' tcx > > ] ,
@@ -158,13 +158,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
158
158
if self . is_constant_pattern_subslice ( prefix) {
159
159
let elem_ty = prefix[ 0 ] . ty ;
160
160
let prefix_valtree = self . simplify_const_pattern_slice_into_valtree ( prefix) ;
161
- // FIXME(jieyouxu): triple check these place calculations!
161
+ let elem =
162
+ ProjectionElem :: Subslice { from : 0 , to : prefix. len ( ) as u64 , from_end : false } ;
162
163
if let Some ( match_pair) = self . valtree_to_match_pair (
163
164
base_pat. ty ,
164
165
base_pat. span ,
165
166
prefix. len ( ) as u64 ,
166
167
prefix_valtree,
167
- place. base ( ) . into ( ) ,
168
+ place. clone_project ( elem ) ,
168
169
elem_ty,
169
170
) {
170
171
match_pairs. push ( match_pair) ;
@@ -318,7 +319,7 @@ impl<'pat, 'tcx> MatchPairTree<'pat, 'tcx> {
318
319
cx. prefix_slice_suffix (
319
320
pattern,
320
321
& mut subpairs,
321
- & place_builder,
322
+ place_builder,
322
323
prefix,
323
324
slice,
324
325
suffix,
@@ -329,7 +330,7 @@ impl<'pat, 'tcx> MatchPairTree<'pat, 'tcx> {
329
330
cx. prefix_slice_suffix (
330
331
pattern,
331
332
& mut subpairs,
332
- & place_builder,
333
+ place_builder,
333
334
prefix,
334
335
slice,
335
336
suffix,
0 commit comments