rust/tests/ui/nll/generator-upvar-mutability.rs

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

15 lines
213 B
Rust
Raw Normal View History

2018-07-03 14:12:09 -05:00
// Check that generators respect the muatability of their upvars.
2022-04-01 12:13:25 -05:00
#![feature(generators)]
2018-07-03 14:12:09 -05:00
fn mutate_upvar() {
let x = 0;
move || {
x = 1;
//~^ ERROR
yield;
};
}
fn main() {}