mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-27 14:24:08 +00:00
15 lines
218 B
Rust
15 lines
218 B
Rust
![]() |
// Check that generators respect the muatability of their upvars.
|
||
|
|
||
|
#![feature(generators, nll)]
|
||
|
|
||
|
fn mutate_upvar() {
|
||
|
let x = 0;
|
||
|
move || {
|
||
|
x = 1;
|
||
|
//~^ ERROR
|
||
|
yield;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
fn main() {}
|