summaryrefslogtreecommitdiffstats
path: root/tests/ui/try-block/try-block-in-while.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/try-block/try-block-in-while.rs')
-rw-r--r--tests/ui/try-block/try-block-in-while.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/try-block/try-block-in-while.rs b/tests/ui/try-block/try-block-in-while.rs
new file mode 100644
index 000000000..69793df52
--- /dev/null
+++ b/tests/ui/try-block/try-block-in-while.rs
@@ -0,0 +1,8 @@
+// compile-flags: --edition 2018
+
+#![feature(try_blocks)]
+
+fn main() {
+ while try { false } {}
+ //~^ ERROR a `try` block must
+}