@@ -100,7 +100,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
100100 . collect ( ) ;
101101
102102 // 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 > ( ) ;
104104 let pre_binding_blocks: Vec < _ > = ( 0 ..=candidate_count)
105105 . map ( |_| self . cfg . start_new_block ( ) )
106106 . collect ( ) ;
@@ -337,7 +337,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
337337
338338 pub fn place_into_pattern (
339339 & mut self ,
340- mut block : BasicBlock ,
340+ block : BasicBlock ,
341341 irrefutable_pat : Pattern < ' tcx > ,
342342 initializer : & Place < ' tcx > ,
343343 set_match_place : bool ,
@@ -359,7 +359,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
359359
360360 // Simplify the candidate. Since the pattern is irrefutable, this should
361361 // always convert all match-pairs into bindings.
362- unpack ! ( block = self . simplify_candidate( block , & mut candidate) ) ;
362+ self . simplify_candidate ( & mut candidate) ;
363363
364364 if !candidate. match_pairs . is_empty ( ) {
365365 span_bug ! (
@@ -745,7 +745,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
745745 // complete, all the match pairs which remain require some
746746 // form of test, whether it be a switch or pattern comparison.
747747 for candidate in & mut candidates {
748- unpack ! ( block = self . simplify_candidate( block , candidate) ) ;
748+ self . simplify_candidate ( candidate) ;
749749 }
750750
751751 // The candidates are sorted by priority. Check to see
@@ -1035,7 +1035,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
10351035 test, match_pair
10361036 ) ;
10371037 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 ( ) ] ;
10391039
10401040 // Sort the candidates into the appropriate vector in
10411041 // `target_candidates`. Note that at some point we may
0 commit comments