diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-04 19:42:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-04 19:42:10 +0100 |
| commit | 592beb1c25c1448402aaeb583e997213a5b9b535 (patch) | |
| tree | 28409711893e527812bbb3c7f75cc0e0cf2fc50e | |
| parent | b23945c9b2f51bd4d4aecc8a4e3bfeffc7c2a896 (diff) | |
| parent | bedd81ef2afdf5979e316cde4c664bd13d49b266 (diff) | |
| download | rust-592beb1c25c1448402aaeb583e997213a5b9b535.tar.gz rust-592beb1c25c1448402aaeb583e997213a5b9b535.zip | |
Rollup merge of #120540 - Fishrock123:test-try-block-in-match-arm, r=compiler-errors
add test for try-block-in-match-arm This is noted as an implementation concern under the tracking issue for `?` and `try` blocks. (Issue 31436) Refs: https://github.com/rust-lang/rust/issues/31436
| -rw-r--r-- | tests/ui/try-block/try-block-in-match-arm.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/try-block/try-block-in-match-arm.rs b/tests/ui/try-block/try-block-in-match-arm.rs new file mode 100644 index 00000000000..ea004ebe29f --- /dev/null +++ b/tests/ui/try-block/try-block-in-match-arm.rs @@ -0,0 +1,11 @@ +// check-pass +// compile-flags: --edition 2018 + +#![feature(try_blocks)] + +fn main() { + let _ = match 1 { + 1 => try {} + _ => Ok::<(), ()>(()), + }; +} |
