diff options
Diffstat (limited to 'tests/errors/use_after_inferred_give.zc')
| -rw-r--r-- | tests/errors/use_after_inferred_give.zc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/errors/use_after_inferred_give.zc b/tests/errors/use_after_inferred_give.zc new file mode 100644 index 0000000..19841cb --- /dev/null +++ b/tests/errors/use_after_inferred_give.zc @@ -0,0 +1,6 @@ +namespace; +include rt; + +// expect: x: used after it was given away; owner x was transferred on line 6 (declared on line 6) +fn take(.d p) { return p[0]; } +fn main() { let x = rt.new(3); take(x); return x[0]; } |
