summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.rs
blob: 524459291f85353470b45ab532544dd54f44f953 (plain)
1
2
3
4
5
6
7
8
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
    };
}