summaryrefslogtreecommitdiffstats
path: root/tests/ui/explicit-tail-calls/become-outside.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/explicit-tail-calls/become-outside.rs')
-rw-r--r--tests/ui/explicit-tail-calls/become-outside.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/explicit-tail-calls/become-outside.rs b/tests/ui/explicit-tail-calls/become-outside.rs
new file mode 100644
index 000000000..51b4389c8
--- /dev/null
+++ b/tests/ui/explicit-tail-calls/become-outside.rs
@@ -0,0 +1,15 @@
+// revisions: constant array
+#![allow(incomplete_features)]
+#![feature(explicit_tail_calls)]
+
+#[cfg(constant)]
+const _: () = {
+ become f(); //[constant]~ error: become statement outside of function body
+};
+
+#[cfg(array)]
+struct Bad([(); become f()]); //[array]~ error: become statement outside of function body
+
+fn f() {}
+
+fn main() {}