@@ -68,18 +68,6 @@ fn combine_seq(first: NeverLoopResult, second: NeverLoopResult) -> NeverLoopResu
68
68
}
69
69
}
70
70
71
- // Combine two results where both parts are called but not necessarily in order.
72
- #[ must_use]
73
- fn combine_both ( left : NeverLoopResult , right : NeverLoopResult ) -> NeverLoopResult {
74
- match ( left, right) {
75
- ( NeverLoopResult :: MayContinueMainLoop , _) | ( _, NeverLoopResult :: MayContinueMainLoop ) => {
76
- NeverLoopResult :: MayContinueMainLoop
77
- } ,
78
- ( NeverLoopResult :: AlwaysBreak , _) | ( _, NeverLoopResult :: AlwaysBreak ) => NeverLoopResult :: AlwaysBreak ,
79
- ( NeverLoopResult :: Otherwise , NeverLoopResult :: Otherwise ) => NeverLoopResult :: Otherwise ,
80
- }
81
- }
82
-
83
71
// Combine two results where only one of the part may have been executed.
84
72
#[ must_use]
85
73
fn combine_branches ( b1 : NeverLoopResult , b2 : NeverLoopResult ) -> NeverLoopResult {
@@ -139,7 +127,7 @@ fn never_loop_expr(expr: &Expr<'_>, ignore_ids: &mut Vec<HirId>, main_loop_id: H
139
127
ExprKind :: Struct ( _, fields, base) => {
140
128
let fields = never_loop_expr_all ( & mut fields. iter ( ) . map ( |f| f. expr ) , ignore_ids, main_loop_id) ;
141
129
if let Some ( base) = base {
142
- combine_both ( fields, never_loop_expr ( base, ignore_ids, main_loop_id) )
130
+ combine_seq ( fields, never_loop_expr ( base, ignore_ids, main_loop_id) )
143
131
} else {
144
132
fields
145
133
}
@@ -218,7 +206,7 @@ fn never_loop_expr(expr: &Expr<'_>, ignore_ids: &mut Vec<HirId>, main_loop_id: H
218
206
| InlineAsmOperand :: SymFn { .. }
219
207
| InlineAsmOperand :: SymStatic { .. } => NeverLoopResult :: Otherwise ,
220
208
} )
221
- . fold ( NeverLoopResult :: Otherwise , combine_both ) ,
209
+ . fold ( NeverLoopResult :: Otherwise , combine_seq ) ,
222
210
ExprKind :: Yield ( _, _)
223
211
| ExprKind :: Closure { .. }
224
212
| ExprKind :: Path ( _)
@@ -234,7 +222,7 @@ fn never_loop_expr_all<'a, T: Iterator<Item = &'a Expr<'a>>>(
234
222
main_loop_id : HirId ,
235
223
) -> NeverLoopResult {
236
224
es. map ( |e| never_loop_expr ( e, ignore_ids, main_loop_id) )
237
- . fold ( NeverLoopResult :: Otherwise , combine_both )
225
+ . fold ( NeverLoopResult :: Otherwise , combine_seq )
238
226
}
239
227
240
228
fn never_loop_expr_branch < ' a , T : Iterator < Item = & ' a Expr < ' a > > > (
0 commit comments