diff options
Diffstat (limited to 'tests/ui/try-block/try-block-catch.rs')
-rw-r--r-- | tests/ui/try-block/try-block-catch.rs | 10 |
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 000000000..d16501561 --- /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 +} |