rust/tests/ui/pattern/bindings-after-at
Guillaume Boisseau 30976fbe2b
Rollup merge of #121716 - Nadrieril:simple-binding-order, r=matthewjasper
match lowering: Lower bindings in a predictable order

After the recent refactorings, we can now lower bindings in a truly predictable order. The order in https://github.com/rust-lang/rust/pull/120214 was an improvement but not very clear. With this PR, we lower bindings from left to right, with the special case that `x @ pat` is traversed as `pat @ x` (i.e. `x` is lowered after any bindings in `pat`).

This description only applies in the absence of or-patterns. Or-patterns make everything complicated, because the binding place depends on the subpattern. Until I have a better idea I leave them to be handled in whatever weird order arises from today's code.

r? `@matthewjasper`
2024-03-02 20:13:23 +01:00
..
bind-by-copy-or-pat.rs Add test for the known case that doesn't work 2024-02-28 01:41:25 +01:00
bind-by-copy-or-pat.stderr Add test for the known case that doesn't work 2024-02-28 01:41:25 +01:00
bind-by-copy.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
bind-by-move-neither-can-live-while-the-other-survives-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
bind-by-move-neither-can-live-while-the-other-survives-1.stderr Shrink binding span. 2023-04-03 15:59:21 +00:00
bind-by-move-no-subbindings-fun-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
bind-by-move-no-subbindings-fun-param.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
borrowck-move-and-move.rs Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-move-and-move.stderr Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-at-and-box-pass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
borrowck-pat-at-and-box.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-pat-at-and-box.stderr Run check_match and check_liveness when MIR is built instead of having an explicit phase for them 2023-04-21 22:32:38 +00:00
borrowck-pat-by-copy-bindings-in-at.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
borrowck-pat-by-move-and-ref-inverse-promotion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-pat-by-move-and-ref-inverse-promotion.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
borrowck-pat-by-move-and-ref-inverse.rs Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-by-move-and-ref-inverse.stderr Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-by-move-and-ref.rs Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-by-move-and-ref.stderr Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-ref-both-sides.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
borrowck-pat-ref-mut-and-ref.rs Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-ref-mut-and-ref.stderr Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-ref-mut-twice.rs Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
borrowck-pat-ref-mut-twice.stderr Put new bindings first in refutable cases too 2024-01-25 02:56:02 +01:00
box-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
copy-and-move-mixed.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
copy-and-move-mixed.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
default-binding-modes-both-sides-independent.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
default-binding-modes-both-sides-independent.stderr Shrink binding span. 2023-04-03 15:59:21 +00:00
nested-binding-mode-lint.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
nested-binding-modes-mut.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
nested-binding-modes-mut.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
nested-binding-modes-ref.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
nested-binding-modes-ref.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
nested-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
nested-type-ascription-syntactically-invalid.rs Rip it out 2023-05-01 16:15:13 +08:00
nested-type-ascription-syntactically-invalid.stderr Detect more cases of = to : typo 2024-03-01 02:03:00 +00:00
or-patterns-box-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
or-patterns-slice-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
or-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
pat-at-same-name-both.rs Continue to borrowck even if there were previous errors 2024-02-08 08:10:43 +00:00
pat-at-same-name-both.stderr Continue to borrowck even if there were previous errors 2024-02-08 08:10:43 +00:00
slice-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
wild-before-at-syntactically-rejected.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
wild-before-at-syntactically-rejected.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00