mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
aef0f4024a
And suggest adding the `#[coroutine]` to the closure
24 lines
413 B
Rust
24 lines
413 B
Rust
//@ run-pass
|
|
#![allow(dead_code)]
|
|
|
|
#![feature(coroutines)]
|
|
|
|
enum Enum {
|
|
A(String),
|
|
B
|
|
}
|
|
|
|
fn main() {
|
|
#[coroutine] || { //~ WARN unused coroutine that must be used
|
|
loop {
|
|
if let true = true {
|
|
match Enum::A(String::new()) {
|
|
Enum::A(_var) => {}
|
|
Enum::B => {}
|
|
}
|
|
}
|
|
yield;
|
|
}
|
|
};
|
|
}
|