summaryrefslogtreecommitdiffstats
path: root/tests/ui/generator/reborrow-mut-upvar.rs
blob: dbd9e24e205c8e31c3ff2004100fd081085d0359 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-pass

#![feature(generators)]

fn _run(bar: &mut i32) {
    || { //~ WARN unused generator that must be used
        {
            let _baz = &*bar;
            yield;
        }

        *bar = 2;
    };
}

fn main() {}