about summary refs log tree commit diff
path: root/src/test/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-01-09 00:29:12 +0900
committerGitHub <noreply@github.com>2020-01-09 00:29:12 +0900
commit429a7e7522fcec73ce2cbbc1ef47688276ce08d5 (patch)
tree74b807f9023ccc7b972b8dcf2a5df4265233aba3 /src/test/debuginfo/enum-thinlto.rs
parent256f401b85da7ae6e3d146a41089897c37c2589a (diff)
parente01e8b9256587a074968b440aa30d43b31642cb5 (diff)
downloadrust-429a7e7522fcec73ce2cbbc1ef47688276ce08d5.tar.gz
rust-429a7e7522fcec73ce2cbbc1ef47688276ce08d5.zip
Rollup merge of #67849 - cjkenn:check-sorted-words, r=estebank
Add a check for swapped words when we can't find an identifier

Fixes #66968

Couple things here:
1. The matches take the precedence of case insensitive match, then levenshtein match, then swapped words match. Doing this allows us to not even check for swapped words unless the other checks return `None`.
2. I've assumed that the swapped words check is not held to the limits of the max levenshtein distance threshold (ie. we want to try and find a match even if the levenshtein distance is very high). This means that we cannot perform this check in the `fold` that occurs after the `filter_map` call, because the candidate will be filtered out. So, I've split this into two separate `fold` calls, and had to collect the original iterator into a vec so it can be copied (I don't think we want to change the function signature to take a vec or require the `Copy` trait). An alternative implemenation may be to remove the `filter_map`, `fold` over the entire iterator, and do a check against `max_dist` inside the relevant cases there.

r? @estebank
Diffstat (limited to 'src/test/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions