diff options
| author | bors <bors@rust-lang.org> | 2024-03-22 12:29:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-22 12:29:42 +0000 |
| commit | 1447f9d38ca388ca178a544534b3cff72945fa1e (patch) | |
| tree | 51b4cffdfe26ba21cda4793ce8dbe20d5f06c965 /src/tools/rustfmt/tests/source | |
| parent | eff958c59e8c07ba0515e164b825c9001b242294 (diff) | |
| parent | a5de4fb2a585d0d69f62abd1f1765fef430786d9 (diff) | |
| download | rust-1447f9d38ca388ca178a544534b3cff72945fa1e.tar.gz rust-1447f9d38ca388ca178a544534b3cff72945fa1e.zip | |
Auto merge of #122869 - matthiaskrgr:rollup-0navj4l, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #121619 (Experimental feature postfix match) - #122370 (Gracefully handle `AnonConst` in `diagnostic_hir_wf_check()`) - #122537 (interpret/allocation: fix aliasing issue in interpreter and refactor getters a bit) - #122542 (coverage: Clean up marker statements that aren't needed later) - #122800 (Add `NonNull::<[T]>::is_empty`.) - #122820 (Stop using `<DefId as Ord>` in various diagnostic situations) - #122847 (Suggest `RUST_MIN_STACK` workaround on overflow) - #122855 (Fix Itanium mangling usizes) - #122863 (add more ice tests ) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/tools/rustfmt/tests/source')
| -rw-r--r-- | src/tools/rustfmt/tests/source/postfix-match/pf-match.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/postfix-match/pf-match.rs b/src/tools/rustfmt/tests/source/postfix-match/pf-match.rs new file mode 100644 index 00000000000..b2366723631 --- /dev/null +++ b/src/tools/rustfmt/tests/source/postfix-match/pf-match.rs @@ -0,0 +1,20 @@ +#![feature(postfix_match)] + +fn main() { + let val = Some(42); + + val.match { + Some(_) => 2, + _ => 1 + }; + + Some(2).match { + Some(_) => true, + None => false + }.match { + false => "ferris is cute", + true => "I turn cats in to petted cats", + }.match { + _ => (), + } +} \ No newline at end of file |
