@@ -835,11 +835,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
835
835
new_temp
836
836
}
837
837
838
- fn promote_candidate (
839
- mut self ,
840
- candidate : Candidate ,
841
- next_promoted_id : usize ,
842
- ) -> Option < Body < ' tcx > > {
838
+ fn promote_candidate ( mut self , candidate : Candidate , next_promoted_id : usize ) -> Body < ' tcx > {
843
839
let def = self . source . source . with_opt_param ( ) ;
844
840
let mut rvalue = {
845
841
let promoted = & mut self . promoted ;
@@ -938,7 +934,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
938
934
939
935
let span = self . promoted . span ;
940
936
self . assign ( RETURN_PLACE , rvalue, span) ;
941
- Some ( self . promoted )
937
+ self . promoted
942
938
}
943
939
}
944
940
@@ -1011,11 +1007,9 @@ pub fn promote_candidates<'tcx>(
1011
1007
keep_original : false ,
1012
1008
} ;
1013
1009
1014
- //FIXME(oli-obk): having a `maybe_push()` method on `IndexVec` might be nice
1015
- if let Some ( mut promoted) = promoter. promote_candidate ( candidate, promotions. len ( ) ) {
1016
- promoted. source . promoted = Some ( promotions. next_index ( ) ) ;
1017
- promotions. push ( promoted) ;
1018
- }
1010
+ let mut promoted = promoter. promote_candidate ( candidate, promotions. len ( ) ) ;
1011
+ promoted. source . promoted = Some ( promotions. next_index ( ) ) ;
1012
+ promotions. push ( promoted) ;
1019
1013
}
1020
1014
1021
1015
// Insert each of `extra_statements` before its indicated location, which
0 commit comments