2018-09-06 14:41:12 +02:00
|
|
|
// run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(dead_code)]
|
2018-09-06 14:41:12 +02:00
|
|
|
|
2017-09-10 22:34:56 +02:00
|
|
|
#![feature(generators)]
|
|
|
|
|
|
|
|
enum Enum {
|
|
|
|
A(String),
|
|
|
|
B
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2020-07-28 00:00:00 +00:00
|
|
|
|| { //~ WARN unused generator that must be used
|
2017-09-10 22:34:56 +02:00
|
|
|
loop {
|
|
|
|
if let true = true {
|
|
|
|
match Enum::A(String::new()) {
|
|
|
|
Enum::A(_var) => {}
|
|
|
|
Enum::B => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
}
|
|
|
|
};
|
2017-12-30 02:25:40 +08:00
|
|
|
}
|