about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-02-06 02:09:00 +0000
committerbors <bors@rust-lang.org>2023-02-06 02:09:00 +0000
commit7c3f0d6f30eeefa58170012df10008736ac89755 (patch)
treeb8ad1f69eac155e25cbd0376accb01a9371bc3d8 /compiler/rustc_interface/src/errors.rs
parent14ea63a7e005f9ca48bc13df6cb4fc5afe32febe (diff)
parent616a0db7d6c4f1c8dd202c06c6cbe919d171edb1 (diff)
downloadrust-7c3f0d6f30eeefa58170012df10008736ac89755.tar.gz
rust-7c3f0d6f30eeefa58170012df10008736ac89755.zip
Auto merge of #107141 - notriddle:notriddle/max-lev-distance-2023, r=GuillaumeGomez
rustdoc: compute maximum Levenshtein distance based on the query

Preview: https://notriddle.com/notriddle-rustdoc-demos/search-lev-distance-2023/std/index.html?search=regex

The heuristic is pretty close to the name resolver, maxLevDistance = `Math.floor(queryLen / 3)`.

Fixes #103357
Fixes #82131

Similar to https://github.com/rust-lang/rust/pull/103710, but following the suggestion in https://github.com/rust-lang/rust/pull/103710#issuecomment-1296360267 to use `floor` instead of `ceil`, and unblocked now that https://github.com/rust-lang/rust/pull/105796 made it so that setting the max lev distance to `0` doesn't cause substring matches to be removed.
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions