From bedd81ef2afdf5979e316cde4c664bd13d49b266 Mon Sep 17 00:00:00 2001 From: Jeremiah Senkpiel Date: Wed, 31 Jan 2024 16:58:35 -0800 Subject: [PATCH] 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) --- tests/ui/try-block/try-block-in-match-arm.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/ui/try-block/try-block-in-match-arm.rs 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 0000000000000..ea004ebe29f9e --- /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::<(), ()>(()), + }; +}