rust/tests/ui/match
Matthias Krüger 783778c631
Rollup merge of #121619 - RossSmyth:pfix_match, r=petrochenkov
Experimental feature postfix match

This has a basic experimental implementation for the RFC postfix match (rust-lang/rfcs#3295, #121618). [Liaison is](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Postfix.20Match.20Liaison/near/423301844) ```@scottmcm``` with the lang team's [experimental feature gate process](https://github.com/rust-lang/lang-team/blob/master/src/how_to/experiment.md).

This feature has had an RFC for a while, and there has been discussion on it for a while. It would probably be valuable to see it out in the field rather than continue discussing it. This feature also allows to see how popular postfix expressions like this are for the postfix macros RFC, as those will take more time to implement.

It is entirely implemented in the parser, so it should be relatively easy to remove if needed.

This PR is split in to 5 commits to ease review.

1. The implementation of the feature & gating.
2. Add a MatchKind field, fix uses, fix pretty.
3. Basic rustfmt impl, as rustfmt crashes upon seeing this syntax without a fix.
4. Add new MatchSource to HIR for Clippy & other HIR consumers
2024-03-22 11:36:58 +01:00
..
auxiliary
postfix-match Add postfix-match experimental feature 2024-03-05 23:34:45 -05:00
const_non_normal_zst_ref_pattern.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dont-highlight-diverging-arms.rs Remove a suggestion that is redundant 2024-02-15 17:20:44 +00:00
dont-highlight-diverging-arms.stderr Remove a suggestion that is redundant 2024-02-15 17:20:44 +00:00
expr_before_ident_pat.rs
expr_before_ident_pat.stderr
expr-match-panic-fn.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
expr-match-panic.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
guards-parenthesized-and.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
guards.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-5530.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-11319.rs
issue-11319.stderr
issue-11940.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-12552.rs
issue-12552.stderr
issue-18060.rs Allow lint where we don't care 2024-03-09 01:13:42 +01:00
issue-26251.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-26996.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-27021.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-33498.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-36401.rs Move tests 2024-03-03 16:30:48 -03:00
issue-37598.rs Move tests 2024-03-03 16:30:48 -03:00
issue-42679.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-46920-byte-array-patterns.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-56685.rs
issue-56685.stderr
issue-70972-dyn-trait.rs
issue-70972-dyn-trait.stderr
issue-72680.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-72896-non-partial-eq-const.rs make non-PartialEq-typed consts as patterns a hard error 2024-02-25 11:30:10 +01:00
issue-72896-non-partial-eq-const.stderr make non-PartialEq-typed consts as patterns a hard error 2024-02-25 11:30:10 +01:00
issue-74050-end-span.rs
issue-74050-end-span.stderr
issue-82392.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-82392.stdout [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-82866.rs
issue-82866.stderr
issue-84434.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-91058.rs
issue-91058.stderr
issue-92100.rs
issue-92100.stderr
issue-112438.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-113012.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-114691.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-115681.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
match_non_exhaustive.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
match_non_exhaustive.stderr
match-arm-resolving-to-never.rs
match-arm-resolving-to-never.stderr Only point out non-diverging arms for match suggestions 2024-02-15 15:44:46 +00:00
match-bot-panic.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
match-disc-bot.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
match-float.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
match-fn-call.rs
match-fn-call.stderr
match-ill-type2.rs
match-ill-type2.stderr
match-incompat-type-semi.rs
match-incompat-type-semi.stderr
match-join.rs
match-join.stderr
match-no-arms-unreachable-after.rs
match-no-arms-unreachable-after.stderr
match-on-negative-integer-ranges.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
match-pattern-field-mismatch-2.rs
match-pattern-field-mismatch-2.stderr
match-pattern-field-mismatch.rs
match-pattern-field-mismatch.stderr
match-range-fail-2.rs
match-range-fail-2.stderr
match-range-fail.rs
match-range-fail.stderr
match-ref-mut-invariance.rs
match-ref-mut-invariance.stderr
match-ref-mut-let-invariance.rs
match-ref-mut-let-invariance.stderr
match-ref-mut-stability.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
match-struct.rs
match-struct.stderr
match-tag-nullary.rs
match-tag-nullary.stderr
match-tag-unary.rs
match-tag-unary.stderr
match-tail-expr-never-type-error.rs
match-tail-expr-never-type-error.stderr
match-type-err-first-arm.rs
match-type-err-first-arm.stderr
match-unresolved-one-arm.rs
match-unresolved-one-arm.stderr
match-vec-mismatch-2.rs
match-vec-mismatch-2.stderr
match-wildcards.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
non-first-arm-doesnt-match-expected-return-type.rs
non-first-arm-doesnt-match-expected-return-type.stderr
pattern-deref-miscompile.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
single-line.rs
single-line.stderr
validate-range-endpoints.rs
validate-range-endpoints.stderr