@@ -157,9 +157,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
157
157
elem_ty : Ty < ' tcx > ,
158
158
) -> MatchPairTree < ' pat , ' tcx > {
159
159
let tcx = self . tcx ;
160
- tracing:: warn!( "source pattern type: {:?}" , src_pat_ty) ;
161
160
let ( const_ty, pat_ty) = match src_pat_ty. kind ( ) {
162
- // wait is source path the wrong thing to care about?
163
161
ty:: Slice ( _) => (
164
162
Ty :: new_imm_ref (
165
163
tcx,
@@ -174,24 +172,21 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
174
172
tcx. lifetimes . re_erased ,
175
173
Ty :: new_array ( tcx, elem_ty, subslice_len) ,
176
174
) ,
177
- Ty :: new_array ( tcx, elem_ty, subslice_len) , // WRONG TYPE with too short array len for the move
175
+ Ty :: new_array ( tcx, elem_ty, subslice_len) ,
178
176
) ,
179
- _ => todo ! ( ) ,
177
+ _ => unreachable ! ( ) ,
180
178
} ;
181
179
182
- tracing:: warn!( "const and new pattern type: {:?}, {:?}" , const_ty, pat_ty) ;
183
-
184
- let r#const = ty:: Const :: new ( tcx, ty:: ConstKind :: Value ( const_ty, valtree) ) ;
185
- let r#const2 = Const :: Ty ( const_ty, r#const) ;
180
+ let ty_cost = ty:: Const :: new ( tcx, ty:: ConstKind :: Value ( const_ty, valtree) ) ;
181
+ let value = Const :: Ty ( const_ty, r#ty_cost) ;
182
+ let test_case = TestCase :: Constant { value } ;
186
183
187
184
let pattern = tcx. arena . alloc ( Pat {
188
185
ty : pat_ty,
189
186
span,
190
- kind : PatKind :: Constant { value : Const :: Ty ( const_ty , r#const ) } ,
187
+ kind : PatKind :: Constant { value } ,
191
188
} ) ;
192
189
193
- let test_case = TestCase :: Constant { value : r#const2 } ;
194
-
195
190
MatchPairTree {
196
191
place : Some ( place. to_place ( self ) ) ,
197
192
test_case,
0 commit comments