rust/tests/ui/nll/coroutine-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

2023-10-19 16:46:28 -05:00
// Check that coroutines respect the muatability of their upvars.
2018-07-03 14:12:09 -05:00
2023-10-19 16:46:28 -05:00
#![feature(coroutines)]
2018-07-03 14:12:09 -05:00
fn mutate_upvar() {
let x = 0;
move || {
x = 1;
//~^ ERROR
yield;
};
}
fn main() {}