2 // Test that in a by-ref once closure we move some variables even as
3 // we capture others by mutable reference.
5 fn call<F>(f: F) where F : FnOnce() {
10 let mut x = vec![format!("Hello")];
11 let y = vec![format!("World")];
13 // Here: `x` must be captured with a mutable reference in
14 // order for us to append on it, and `y` must be captured by
20 assert_eq!(x.len(), 2);
21 assert_eq!(&*x[0], "Hello");
22 assert_eq!(&*x[1], "World");