Skip to content

Commit 4fc3c6b

Browse files
committed
add comment
1 parent 7b4f436 commit 4fc3c6b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_span/src/edit_distance.rs

+3
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ fn find_best_match_for_name_impl(
218218
}
219219
}
220220

221+
// We have a tie among several candidates, try to select the best among them ignoring substrings.
222+
// For example, the candidates list `force_capture`, `capture`, and user inputed `forced_capture`,
223+
// we select `force_capture` with a extra round of edit distance calculation.
221224
if next_candidates.len() > 1 {
222225
debug_assert!(use_substring_score);
223226
best = find_best_match_for_name_impl(

0 commit comments

Comments
 (0)