about summary refs log tree commit diff
path: root/tests/ui/nll/coroutine-upvar-mutability.rs
blob: a7d14173fb9fc57eebcbce4a03e9308588718c84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Check that coroutines respect the muatability of their upvars.

#![feature(coroutines)]

fn mutate_upvar() {
    let x = 0;

    #[coroutine]
    move || {
        x = 1;
        //~^ ERROR
        yield;
    };
}

fn main() {}