Skip to content

Commit c0c4898

Browse files
committed
Method probe: check doc aliases after edit distance.
1 parent 6d091b2 commit c0c4898

File tree

1 file changed

+3
-6
lines changed
  • compiler/rustc_hir_typeck/src/method

1 file changed

+3
-6
lines changed

compiler/rustc_hir_typeck/src/method/probe.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,17 +2373,14 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
23732373
if !self.is_relevant_kind_for_mode(x.kind) {
23742374
return false;
23752375
}
2376-
if self.matches_by_doc_alias(x.def_id) {
2377-
return true;
2378-
}
2379-
match edit_distance_with_substrings(
2376+
if let Some(d) = edit_distance_with_substrings(
23802377
name.as_str(),
23812378
x.name().as_str(),
23822379
max_dist,
23832380
) {
2384-
Some(d) => d > 0,
2385-
None => false,
2381+
return d > 0;
23862382
}
2383+
self.matches_by_doc_alias(x.def_id)
23872384
})
23882385
.copied()
23892386
.collect()

0 commit comments

Comments
 (0)