about summary refs log tree commit diff
path: root/compiler/rustc_span/src/edit_distance.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_span/src/edit_distance.rs')
-rw-r--r--compiler/rustc_span/src/edit_distance.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/edit_distance.rs b/compiler/rustc_span/src/edit_distance.rs
index 19c4aae97ef..9fe9e3a7a5f 100644
--- a/compiler/rustc_span/src/edit_distance.rs
+++ b/compiler/rustc_span/src/edit_distance.rs
@@ -218,6 +218,9 @@ fn find_best_match_for_name_impl(
         }
     }
 
+    // We have a tie among several candidates, try to select the best among them ignoring substrings.
+    // For example, the candidates list `force_capture`, `capture`, and user inputed `forced_capture`,
+    // we select `force_capture` with a extra round of edit distance calculation.
     if next_candidates.len() > 1 {
         debug_assert!(use_substring_score);
         best = find_best_match_for_name_impl(