rust/tests/ui/borrowck/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.rs
2023-01-11 09:32:08 +00:00

9 lines
239 B
Rust

fn main() {
let mut vec: Vec<i32> = Vec::new();
let closure = move || {
vec.clear();
let mut iter = vec.iter();
move || { iter.next() } //~ ERROR captured variable cannot escape `FnMut` closure bod
};
}