1 // Test that we detect nested calls that could free pointers evaluated
2 // for earlier arguments.
6 fn rewrite(v: &mut Box<usize>) -> usize {
11 fn add(v: &usize, w: Box<usize>) -> usize {
16 let mut a: Box<_> = Box::new(1);
18 // Note the danger here:
20 // the pointer for the first argument has already been
21 // evaluated, but it gets moved when evaluating the second
25 a); //~ ERROR cannot move
29 let mut a: Box<_> = Box::new(1);
32 a); //~ ERROR cannot move