about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2020-04-07 19:30:16 +0200
committerJonas Schievink <jonasschievink@gmail.com>2020-04-07 19:30:16 +0200
commitb8f416d67ff77d6eb71902895b59abbfb50737db (patch)
tree6dd1f31b94088c2a3fe0c918591c0663b1b800a5
parentb30d906a983f24e4c03a64b032485ff9950d83b2 (diff)
downloadrust-b8f416d67ff77d6eb71902895b59abbfb50737db.tar.gz
rust-b8f416d67ff77d6eb71902895b59abbfb50737db.zip
Further improve comments
-rw-r--r--src/librustc_mir_build/lints.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustc_mir_build/lints.rs b/src/librustc_mir_build/lints.rs
index 74ab6025415..a7370c36f0b 100644
--- a/src/librustc_mir_build/lints.rs
+++ b/src/librustc_mir_build/lints.rs
@@ -29,8 +29,9 @@ fn check_fn_for_unconditional_recursion<'tcx>(
 ) {
     let self_calls = find_blocks_calling_self(tcx, &body, def_id);
 
-    // Stores a list of `Span`s for every basic block. Those are the spans of `Call` terminators
-    // where we know that one of them will definitely be reached.
+    // Stores a list of `Span`s for every basic block. Those are the spans of self-calls where we
+    // know that one of them will definitely be reached. If the list is empty, the block either
+    // wasn't processed yet or will not always go to a self-call.
     let mut results = IndexVec::from_elem_n(vec![], body.basic_blocks().len());
 
     // We start the analysis at the self calls and work backwards.
@@ -51,7 +52,7 @@ fn check_fn_for_unconditional_recursion<'tcx>(
             // If *all* successors of `bb` lead to a self-call, emit notes at all of their
             // locations.
 
-            // Converging successors without unwind paths.
+            // Determine all "relevant" successors. We ignore successors only reached via unwinding.
             let terminator = body[bb].terminator();
             let relevant_successors = match &terminator.kind {
                 TerminatorKind::Call { destination: None, .. }