@@ -100,7 +100,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
100
100
. collect ( ) ;
101
101
102
102
// create binding start block for link them by false edges
103
- let candidate_count = arms. iter ( ) . fold ( 0 , |ac , c| ac + c. patterns . len ( ) ) ;
103
+ let candidate_count = arms. iter ( ) . map ( | c| c. patterns . len ( ) ) . sum :: < usize > ( ) ;
104
104
let pre_binding_blocks: Vec < _ > = ( 0 ..=candidate_count)
105
105
. map ( |_| self . cfg . start_new_block ( ) )
106
106
. collect ( ) ;
@@ -337,7 +337,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
337
337
338
338
pub fn place_into_pattern (
339
339
& mut self ,
340
- mut block : BasicBlock ,
340
+ block : BasicBlock ,
341
341
irrefutable_pat : Pattern < ' tcx > ,
342
342
initializer : & Place < ' tcx > ,
343
343
set_match_place : bool ,
@@ -359,7 +359,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
359
359
360
360
// Simplify the candidate. Since the pattern is irrefutable, this should
361
361
// always convert all match-pairs into bindings.
362
- unpack ! ( block = self . simplify_candidate( block , & mut candidate) ) ;
362
+ self . simplify_candidate ( & mut candidate) ;
363
363
364
364
if !candidate. match_pairs . is_empty ( ) {
365
365
span_bug ! (
@@ -745,7 +745,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
745
745
// complete, all the match pairs which remain require some
746
746
// form of test, whether it be a switch or pattern comparison.
747
747
for candidate in & mut candidates {
748
- unpack ! ( block = self . simplify_candidate( block , candidate) ) ;
748
+ self . simplify_candidate ( candidate) ;
749
749
}
750
750
751
751
// The candidates are sorted by priority. Check to see
@@ -1035,7 +1035,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
1035
1035
test, match_pair
1036
1036
) ;
1037
1037
let target_blocks = self . perform_test ( block, & match_pair. place , & test) ;
1038
- let mut target_candidates: Vec < _ > = ( 0 ..target_blocks . len ( ) ) . map ( |_| vec ! [ ] ) . collect ( ) ;
1038
+ let mut target_candidates = vec ! [ vec! [ ] ; target_blocks . len ( ) ] ;
1039
1039
1040
1040
// Sort the candidates into the appropriate vector in
1041
1041
// `target_candidates`. Note that at some point we may
0 commit comments