rust/tests/ui/coroutine/match-bindings.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
413 B
Rust
Raw Normal View History

//@ run-pass
#![allow(dead_code)]
2023-10-19 16:46:28 -05:00
#![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;
}
};
}