about summary refs log tree commit diff
path: root/tests/ui/try-block/try-block-catch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/try-block/try-block-catch.rs')
-rw-r--r--tests/ui/try-block/try-block-catch.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/try-block/try-block-catch.rs b/tests/ui/try-block/try-block-catch.rs
new file mode 100644
index 00000000000..d165015611d
--- /dev/null
+++ b/tests/ui/try-block/try-block-catch.rs
@@ -0,0 +1,10 @@
+// compile-flags: --edition 2018
+
+#![feature(try_blocks)]
+
+fn main() {
+    let res: Option<bool> = try {
+        true
+    } catch { };
+    //~^ ERROR keyword `catch` cannot follow a `try` block
+}