aboutsummaryrefslogtreecommitdiff
path: root/tests/errors
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errors')
-rw-r--r--tests/errors/alias_scope.zc2
-rw-r--r--tests/errors/plain_return.zc5
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/errors/alias_scope.zc b/tests/errors/alias_scope.zc
index b52bfa8..ee56075 100644
--- a/tests/errors/alias_scope.zc
+++ b/tests/errors/alias_scope.zc
@@ -1,7 +1,7 @@
namespace;
include rt;
-// expect: q: used after it was given away
+// expect: q: borrows from p, which was freed at the end of its block
fn main() {
let q;
{ let p = rt.new(2); q = p + 0; }
diff --git a/tests/errors/plain_return.zc b/tests/errors/plain_return.zc
index c44c533..723ab98 100644
--- a/tests/errors/plain_return.zc
+++ b/tests/errors/plain_return.zc
@@ -2,5 +2,6 @@ namespace;
include rt;
// expect: is called before its body, so its owned return can't be known there
-fn main() { return mk(); }
-fn mk() { return rt.new(1); }
+int* mk() { int* p = rt.new(int); return p; }
+fn main() { return forward(); }
+int* forward() { return mk(); }