rust/tests/ui/borrowck/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
239 B
Rust
Raw Normal View History

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
};
}