rust/tests
Matthias Krüger 226ce31edd
Rollup merge of #108200 - jhpratt:restricted-damerau-levenshtein-distance, r=tmiasko
Use restricted Damerau-Levenshtein distance for diagnostics

This replaces the existing Levenshtein algorithm with the Damerau-Levenshtein algorithm. This means that "ab" to "ba" is one change (a transposition) instead of two (a deletion and insertion). More specifically, this is a _restricted_ implementation, in that "ca" to "abc" cannot be performed as "ca" → "ac" → "abc", as there is an insertion in the middle of a transposition. I believe that errors like that are sufficiently rare that it's not worth taking into account.

This was first brought up [on IRLO](https://internals.rust-lang.org/t/18227) when it was noticed that the diagnostic for `prinltn!` (transposed L and T) was `print!` and not `println!`. Only a single existing UI test was effected, with the result being an objective improvement.

~~I have left the method name and various other references to the Levenshtein algorithm untouched, as the exact manner in which the edit distance is calculated should not be relevant to the caller.~~

r? ``@estebank``

``@rustbot`` label +A-diagnostics +C-enhancement
2023-02-20 14:32:55 +01:00
..
assembly
auxiliary
codegen Auto merge of #107921 - cjgillot:codegen-overflow-check, r=tmiasko 2023-02-19 18:17:26 +00:00
codegen-units
debuginfo
incremental
mir-opt Replace _with_overflow instrinsics in LowerIntrinsics. 2023-02-18 21:45:10 +00:00
pretty
run-make
run-make-fulldeps Remove save-analysis. 2023-02-16 15:14:45 +11:00
run-pass-valgrind
rustdoc Rollup merge of #108129 - GuillaumeGomez:correctly-handle-links-starting-with-whitespace, r=petrochenkov 2023-02-19 14:47:55 +01:00
rustdoc-gui Rollup merge of #107783 - notriddle:notriddle/item-table-ul, r=GuillaumeGomez 2023-02-19 13:03:41 +05:30
rustdoc-js
rustdoc-js-std rustdoc: hide reference methods in search index 2023-02-16 17:21:57 -07:00
rustdoc-json Add regression test for #107677 2023-02-18 18:28:17 +01:00
rustdoc-ui Only include stable lints in rustdoc::all group 2023-02-19 22:05:58 -08:00
ui Rollup merge of #108200 - jhpratt:restricted-damerau-levenshtein-distance, r=tmiasko 2023-02-20 14:32:55 +01:00
ui-fulldeps
COMPILER_TESTS.md