rust/tests
bors 1a086e49f1 Auto merge of #118796 - Nadrieril:fix-exponential-id-match-2, r=cjgillot
Exhaustiveness: Improve complexity on some wide matches

https://github.com/rust-lang/rust/issues/118437 revealed an exponential case in exhaustiveness checking. While [exponential cases are unavoidable](https://compilercrim.es/rust-np/), this one only showed up after my https://github.com/rust-lang/rust/pull/117611 rewrite of the algorithm. I remember anticipating a case like this and dismissing it as unrealistic, but here we are :').

The tricky match is as follows:
```rust
match command {
    BaseCommand { field01: true, .. } => {}
    BaseCommand { field02: true, .. } => {}
    BaseCommand { field03: true, .. } => {}
    BaseCommand { field04: true, .. } => {}
    BaseCommand { field05: true, .. } => {}
    BaseCommand { field06: true, .. } => {}
    BaseCommand { field07: true, .. } => {}
    BaseCommand { field08: true, .. } => {}
    BaseCommand { field09: true, .. } => {}
    BaseCommand { field10: true, .. } => {}
    // ...20 more of the same

    _ => {}
}
```

To fix this, this PR formalizes a concept of "relevancy" (naming is hard) that was already used to decide what patterns to report. Now we track it for every row, which in wide matches like the above can drastically cut on the number of cases we explore. After this fix, the above match is checked with linear-many cases instead of exponentially-many.

Fixes https://github.com/rust-lang/rust/issues/118437

r? `@cjgillot`
2023-12-24 14:40:36 +00: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
debuginfo
incremental rustc_codegen_ssa: Don't let IncorrectCguReuseType errors get lost 2023-12-19 20:20:40 +01:00
mir-opt Enable -Zlint-mir by default for mir-opt tests 2023-12-21 00:00:00 +00:00
pretty Improve print_tts by changing tokenstream::Spacing. 2023-12-11 09:19:09 +11:00
run-make Improve print_tts by changing tokenstream::Spacing. 2023-12-11 09:19:09 +11:00
run-make-fulldeps
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 Rollup merge of #118988 - notriddle:notriddle/varconst, r=GuillaumeGomez 2023-12-15 20:19:56 +01:00
rustdoc-js rustdoc-search: remove parallel searchWords array 2023-12-15 16:26:35 -07:00
rustdoc-js-std Auto merge of #118077 - calebzulawski:sync-portable-simd-2023-11-19, r=workingjubilee 2023-12-02 18:04:01 +00: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 #118796 - Nadrieril:fix-exponential-id-match-2, r=cjgillot 2023-12-24 14:40:36 +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