mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 12:12:19 +01:00
aef0f4024a
And suggest adding the `#[coroutine]` to the closure
17 lines
241 B
Rust
17 lines
241 B
Rust
//@ run-pass
|
|
|
|
#![feature(coroutines)]
|
|
|
|
fn _run(bar: &mut i32) {
|
|
#[coroutine] || { //~ WARN unused coroutine that must be used
|
|
{
|
|
let _baz = &*bar;
|
|
yield;
|
|
}
|
|
|
|
*bar = 2;
|
|
};
|
|
}
|
|
|
|
fn main() {}
|