diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2025-08-02 17:28:17 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2025-08-02 19:04:42 +0000 |
| commit | c0c48984b05e244fc93144d0c1d48db318639b3b (patch) | |
| tree | f52f28258f3574810e48b9a817d30d1618872c60 | |
| parent | 6d091b2baa33698682453c7bb72809554204e434 (diff) | |
| download | rust-c0c48984b05e244fc93144d0c1d48db318639b3b.tar.gz rust-c0c48984b05e244fc93144d0c1d48db318639b3b.zip | |
Method probe: check doc aliases after edit distance.
| -rw-r--r-- | compiler/rustc_hir_typeck/src/method/probe.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs index 1f3969bd93c..f5584e0596a 100644 --- a/compiler/rustc_hir_typeck/src/method/probe.rs +++ b/compiler/rustc_hir_typeck/src/method/probe.rs @@ -2373,17 +2373,14 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> { if !self.is_relevant_kind_for_mode(x.kind) { return false; } - if self.matches_by_doc_alias(x.def_id) { - return true; - } - match edit_distance_with_substrings( + if let Some(d) = edit_distance_with_substrings( name.as_str(), x.name().as_str(), max_dist, ) { - Some(d) => d > 0, - None => false, + return d > 0; } + self.matches_by_doc_alias(x.def_id) }) .copied() .collect() |
