fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// run-rustfix 2// Test that a by-ref `FnMut` closure gets an error when it tries to 3// consume a value. 4 5fn call<F>(f: F) where F : Fn() { 6 f(); 7} 8 9fn main() { 10 let y = vec![format!("World")]; 11 call(|| { 12 y.clone().into_iter(); 13 //~^ ERROR cannot move out of `y`, a captured variable in an `Fn` closure 14 }); 15}