mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
24 lines
399 B
Rust
24 lines
399 B
Rust
// run-pass
|
|
#![allow(dead_code)]
|
|
|
|
#![feature(generators)]
|
|
|
|
enum Enum {
|
|
A(String),
|
|
B
|
|
}
|
|
|
|
fn main() {
|
|
|| { //~ WARN unused generator that must be used
|
|
loop {
|
|
if let true = true {
|
|
match Enum::A(String::new()) {
|
|
Enum::A(_var) => {}
|
|
Enum::B => {}
|
|
}
|
|
}
|
|
yield;
|
|
}
|
|
};
|
|
}
|