blob: 3ee248fc75444a8ae9a8383c345e3bde4430d1d2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
// expect error: a: can't move out of a value with drop
// destructors 6.15.5: pop moves an element out, so it is refused on an array with a drop, whose drop may need the element
include rt;
fn main() {
int*[?] a = drop(rt.new(int*[?]), fn() { rt.put_s("arr drop\n"); });
int* x = rt.new(int); *x = 5; a.push(x);
int* y = a.pop();
rt.put_n(*y);
return 0;
}
// zc0: skip
|