about summary refs log tree commit diff
path: root/tests/ui/parser/can-begin-expr-check.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/can-begin-expr-check.rs')
-rw-r--r--tests/ui/parser/can-begin-expr-check.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/parser/can-begin-expr-check.rs b/tests/ui/parser/can-begin-expr-check.rs
new file mode 100644
index 00000000000..e5be8de79a9
--- /dev/null
+++ b/tests/ui/parser/can-begin-expr-check.rs
@@ -0,0 +1,20 @@
+pub fn main() {
+
+    return;
+    return ();
+    return as ();
+    return return as ();
+    return return return;
+
+    return if true {
+        ()
+    } else {
+        ()
+    };
+
+    loop {
+        return break as ();
+    }
+
+    return enum; //~ ERROR expected one of `;`, `}`, or an operator, found keyword `enum`
+}