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