rust/tests
Matthias Krüger 7fb36f2d3b
Rollup merge of #120214 - Nadrieril:fix-120210, r=pnkfelix
match lowering: consistently lower bindings deepest-first

Currently when lowering match expressions to MIR, we do a funny little dance with the order of bindings. I attempt to explain it in the third commit: we handle refutable (i.e. needing a test) patterns differently than irrefutable ones. This leads to inconsistencies, as reported in https://github.com/rust-lang/rust/issues/120210. The reason we need a dance at all is for situations like:

```rust
fn foo1(x: NonCopyStruct) {
    let y @ NonCopyStruct { copy_field: z } = x;
    // the above should turn into
    let z = x.copy_field;
    let y = x;
}
```

Here the `y ```````@```````` binding will move out of `x`, so we need to copy the field first.

I believe that the inconsistency came about when we fixed https://github.com/rust-lang/rust/issues/69971, and didn't notice that the fix didn't extend to refutable patterns. My guess then is that ordering bindings by "deepest-first, otherwise source order" is a sound choice. This PR implements that (at least I hope, match lowering is hard to follow 🥲).

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

r? ```````@oli-obk``````` since you merged the original fix to https://github.com/rust-lang/rust/issues/69971
cc ```````@matthewjasper```````
2024-02-08 09:06:33 +01:00
..
assembly Add an armv8r-none-eabihf target to support the Cortex-R52. 2024-02-04 16:27:54 -08:00
auxiliary
codegen Rollup merge of #119162 - heiher:direct-access-external-data, r=petrochenkov 2024-02-07 18:24:41 +01:00
codegen-units Update tests 2024-02-07 10:42:01 +08:00
coverage coverage: Make unexpansion of closure bodies more precise 2024-02-05 10:09:46 +11:00
coverage-run-rustdoc coverage: Don't instrument #[automatically_derived] functions 2024-01-22 12:18:57 +11:00
debuginfo Update tests. 2024-01-27 16:38:57 +01:00
incremental fix rebase 2024-02-01 22:38:16 +00:00
mir-opt Rollup merge of #120214 - Nadrieril:fix-120210, r=pnkfelix 2024-02-08 09:06:33 +01:00
pretty Auto merge of #120227 - nnethercote:further-improve-space_between, r=petrochenkov 2024-01-31 02:01:43 +00:00
run-make Update data layouts in custom target tests for LLVM 18 2024-01-31 15:15:59 +01:00
run-make-fulldeps Auto merge of #118899 - veera-sivarajan:fix-makefile, r=Mark-Simulacrum 2024-01-05 07:42:03 +00:00
run-pass-valgrind
rustdoc Rollup merge of #120501 - GuillaumeGomez:glob-reexport-attr-merge-bugfix, r=notriddle 2024-01-31 12:10:53 +01:00
rustdoc-gui Rollup merge of #119746 - notriddle:notriddle/resize-close-modals, r=fmease 2024-01-22 07:56:42 +01:00
rustdoc-js Rollup merge of #118194 - notriddle:notriddle/tuple-unit, r=GuillaumeGomez 2024-01-06 16:07:46 +01:00
rustdoc-js-std Rollup merge of #118194 - notriddle:notriddle/tuple-unit, r=GuillaumeGomez 2024-01-06 16:07:46 +01:00
rustdoc-json
rustdoc-ui Rollup merge of #116284 - RalfJung:no-nan-match, r=cjgillot 2024-02-05 11:07:26 +01:00
ui Rollup merge of #120214 - Nadrieril:fix-120210, r=pnkfelix 2024-02-08 09:06:33 +01:00
ui-fulldeps Update tests 2024-02-07 10:42:01 +08:00
COMPILER_TESTS.md