summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/coroutine-upvar-mutability.rs
blob: 12853b16b9b758df9cca8d247707c76d30938824 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Check that coroutines respect the muatability of their upvars.

#![feature(coroutines)]

fn mutate_upvar() {
    let x = 0;
    move || {
        x = 1;
        //~^ ERROR
        yield;
    };
}

fn main() {}