Skip to content

Commit b8f416d

Browse files
Further improve comments
1 parent b30d906 commit b8f416d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc_mir_build/lints.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ fn check_fn_for_unconditional_recursion<'tcx>(
2929
) {
3030
let self_calls = find_blocks_calling_self(tcx, &body, def_id);
3131

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.
3435
let mut results = IndexVec::from_elem_n(vec![], body.basic_blocks().len());
3536

3637
// We start the analysis at the self calls and work backwards.
@@ -51,7 +52,7 @@ fn check_fn_for_unconditional_recursion<'tcx>(
5152
// If *all* successors of `bb` lead to a self-call, emit notes at all of their
5253
// locations.
5354

54-
// Converging successors without unwind paths.
55+
// Determine all "relevant" successors. We ignore successors only reached via unwinding.
5556
let terminator = body[bb].terminator();
5657
let relevant_successors = match &terminator.kind {
5758
TerminatorKind::Call { destination: None, .. }

0 commit comments

Comments
 (0)