diff options
Diffstat (limited to 'tests/errors/borrow_projection_consume.zc')
| -rw-r--r-- | tests/errors/borrow_projection_consume.zc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/errors/borrow_projection_consume.zc b/tests/errors/borrow_projection_consume.zc new file mode 100644 index 0000000..913f25b --- /dev/null +++ b/tests/errors/borrow_projection_consume.zc @@ -0,0 +1,5 @@ +namespace; +include rt; + +// expect: a borrowed projection cannot transfer ownership +fn main() { int* p = rt.new(int); int* alias = p + 0; rt.free(alias); rt.put_n(p[0]); } |
