mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 03:33:59 +00:00
aef0f4024a
And suggest adding the `#[coroutine]` to the closure
17 lines
231 B
Rust
17 lines
231 B
Rust
// 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() {}
|