rust/tests
Matthias Krüger 2f51bad66b
Rollup merge of #119331 - notriddle:notriddle/maxpatheditdistance, r=GuillaumeGomez
rustdoc-search: count path edits with separate edit limit

Avoids strange-looking results like this one, where the path component seems to be ignored:

![image](https://github.com/rust-lang/rust/assets/1593513/f0ef077a-6e09-4d67-a29d-8cabc1495f66)

Since the two are counted separately elsewhere, they should get their own limits, too. The biggest problem with combining them is that paths are loosely checked by not requiring every component to match, which means that if they are short and matched loosely, they can easily find "drunk typist" matches that make no sense, like this old result:

    std::collections::btree_map::itermut matching slice::itermut
    maxEditDistance = ("slice::itermut".length) / 3 = 14 / 3 = 4
    editDistance("std", "slice") = 4
    editDistance("itermut", "itermut") = 0
        4 + 0 <= 4 PASS

Of course, `slice::itermut` should not match stuff from btreemap. `slice` should not match `std`.

The new result counts them separately:

    maxPathEditDistance = "slice".length / 3 = 5 / 3 = 1
    maxEditDistance = "itermut".length / 3 = 7 / 3 = 2
    editDistance("std", "slice") = 4
        4 <= 1 FAIL

Effectively, this makes path queries less "typo-resistant". It's not zero, but it means `vec` won't match the `v1` prelude.

This commit also adds substring matching to paths. It's stricter than the substring matching in the main part, but loose enough that what I expect to match does.

Queries without parent paths are unchanged.
2023-12-28 18:48:00 +01:00
..
assembly Auto merge of #118491 - cuviper:aarch64-stack-probes, r=wesleywiser 2023-12-14 02:01:13 +00:00
auxiliary
codegen tests: fix overaligned-constant to not over-specify getelementptr instr 2023-12-21 15:53:28 -05:00
codegen-units
coverage coverage: Add a test for async blocks 2023-12-20 18:48:04 +11:00
coverage-run-rustdoc coverage: Rename the run-coverage test mode to coverage-run 2023-11-08 16:41:24 +11:00
debuginfo Check alignment of pointers only when read/written through 2023-11-04 13:01:32 -04:00
incremental rustc_codegen_ssa: Don't let IncorrectCguReuseType errors get lost 2023-12-19 20:20:40 +01:00
mir-opt Auto merge of #119129 - jyn514:verbose, r=compiler-errors,estebank 2023-12-26 12:27:29 +00:00
pretty Make some non-diagnostic-affecting QPath::LangItem into regular qpaths 2023-12-26 04:07:38 +00:00
run-make Improve print_tts by changing tokenstream::Spacing. 2023-12-11 09:19:09 +11:00
run-make-fulldeps Remove more Session methods that duplicate DiagCtxt methods. 2023-12-24 08:17:47 +11:00
run-pass-valgrind
rustdoc Strenghten tests/rustdoc/trait-object-safe.rs to prevent unforeseen regression 2023-12-23 11:28:33 +01:00
rustdoc-gui rustdoc: treat query string + as space 2023-12-26 14:14:28 -07:00
rustdoc-js rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
rustdoc-js-std rustdoc-search: count path edits with separate edit limit 2023-12-26 18:46:17 -07:00
rustdoc-json Add regression test for is_object_safe field on traits 2023-12-23 19:00:17 +01:00
rustdoc-ui Simple modification of diagnostic information 2023-12-21 10:17:11 +08:00
ui Auto merge of #119105 - dtolnay:paren, r=WaffleLapkin 2023-12-27 21:27:26 +00:00
ui-fulldeps Auto merge of #119097 - nnethercote:fix-EmissionGuarantee, r=compiler-errors 2023-12-22 00:03:57 +00:00
COMPILER_TESTS.md