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