File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,9 @@ fn check_fn_for_unconditional_recursion<'tcx>(
29
29
) {
30
30
let self_calls = find_blocks_calling_self ( tcx, & body, def_id) ;
31
31
32
- // Stores a list of `Span`s for every basic block. Those are the spans of `Call` terminators
33
- // where we know that one of them will definitely be reached.
32
+ // Stores a list of `Span`s for every basic block. Those are the spans of self-calls where we
33
+ // know that one of them will definitely be reached. If the list is empty, the block either
34
+ // wasn't processed yet or will not always go to a self-call.
34
35
let mut results = IndexVec :: from_elem_n ( vec ! [ ] , body. basic_blocks ( ) . len ( ) ) ;
35
36
36
37
// We start the analysis at the self calls and work backwards.
@@ -51,7 +52,7 @@ fn check_fn_for_unconditional_recursion<'tcx>(
51
52
// If *all* successors of `bb` lead to a self-call, emit notes at all of their
52
53
// locations.
53
54
54
- // Converging successors without unwind paths .
55
+ // Determine all "relevant" successors. We ignore successors only reached via unwinding .
55
56
let terminator = body[ bb] . terminator ( ) ;
56
57
let relevant_successors = match & terminator. kind {
57
58
TerminatorKind :: Call { destination : None , .. }
You can’t perform that action at this time.
0 commit comments