aboutsummaryrefslogtreecommitdiff
path: root/tests/errors/borrow_resize.zc
blob: 8594f9801ea641b1a67d3d0b578285937c2659ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
namespace;
include rt;

// expect: element borrow was invalidated by array mutation on line 8; borrow created on line 7
fn main() {
 int[?] a = {1,2};
 int* p = &a[0];
 resize(a,3);
 rt.put_n(p[0]);
}