aboutsummaryrefslogtreecommitdiff
path: root/tests/errors/temporary_unknown.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errors/temporary_unknown.zc')
-rw-r--r--tests/errors/temporary_unknown.zc7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/errors/temporary_unknown.zc b/tests/errors/temporary_unknown.zc
new file mode 100644
index 0000000..644e02a
--- /dev/null
+++ b/tests/errors/temporary_unknown.zc
@@ -0,0 +1,7 @@
+namespace;
+include rt;
+
+// expect: a temporary argument requires a proved non-escaping borrow
+char*.u message() { return rt.new(2); }
+unchecked fn unknown(char* p) { rt.put_s(p); }
+fn main() { unknown(message()); }