rust/tests
bors 5baf1e13f5 Auto merge of #122459 - Nadrieril:sort-eq, r=oli-obk
match lowering: sort `Eq` candidates in the failure case too

This is a slight tweak to MIR gen of matches. Take a match like:
```rust
match (s, flag) {
    ("a", _) if foo() => 1,
    ("b", true) => 2,
    ("a", false) => 3,
    (_, true) => 4,
    _ => 5,
}
```
If we switch on `s == "a"`, the first candidate matches, and we learn almost nothing about the second candidate. So there's a choice:
1. (what we do today) stop sorting candidates, keep the "b" case grouped with everything below. This could allow us to be clever here and test on `flag == true` next.
2. (what this PR does) sort "b" into the failure case. The "b" will be alone (fewer opportunities for picking a good test), but that means the two "a" cases require a single test.

Today, we aren't clever in which tests we pick, so this is an unambiguous win. In a future where we pick tests better, idk. Grouping tests as much as possible feels like a generally good strategy.

This was proposed in https://github.com/rust-lang/rust/issues/29623 (9 years ago :D)
2024-03-31 02:12:50 +00:00
..
assembly stabilize ptr.is_aligned, move ptr.is_aligned_to to a new feature gate 2024-03-29 19:59:46 -04:00
auxiliary
codegen Auto merge of #122976 - caibear:optimize_reserve_for_push, r=cuviper 2024-03-30 00:29:24 +00:00
codegen-units Codegen const panic messages as function calls 2024-03-22 09:55:50 -04:00
coverage Eliminate UbCheck for non-standard libraries 2024-03-27 21:02:40 +08:00
coverage-run-rustdoc
debuginfo Add rust-lldb pretty printing for Path and PathBuf 2024-03-29 18:02:26 -06:00
incremental Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
mir-opt Add FileCheck directives to the new tests. 2024-03-30 18:11:41 +01:00
pretty Add MatchKind member to the Match expr for pretty printing & fmt 2024-03-06 00:35:19 -05:00
run-make Auto merge of #122450 - Urgau:simplify-trim-paths-feature, r=michaelwoerister 2024-03-29 14:00:21 +00:00
run-make-fulldeps Soft-destabilize RustcEncodable/RustcDecodable 2024-03-22 13:24:35 -07:00
run-pass-valgrind Add test for Apple's -weak_framework linker argument 2024-03-18 23:27:34 +01:00
rustdoc tests 2024-03-14 14:51:01 +01:00
rustdoc-gui chore: fix some comments 2024-03-27 22:32:53 +08:00
rustdoc-js Rollup merge of #122247 - notriddle:notriddle/search-unbox-limit, r=GuillaumeGomez 2024-03-14 15:44:32 +01:00
rustdoc-js-std rustdoc-search: add search query syntax Fn(T) -> U 2024-03-11 22:27:22 -07:00
rustdoc-json
rustdoc-ui Add regression test for #123158 2024-03-28 11:09:08 +01:00
ui Auto merge of #123085 - tgross35:f16-f128-step4.0-libs-basic-impls, r=Amanieu 2024-03-30 21:58:49 +00:00
ui-fulldeps Normalize the result of Fields::ty_with_args 2024-03-28 13:22:10 -07:00
COMPILER_TESTS.md