rust/tests/ui/coroutine/reinit-in-match-guard.rs

26 lines
390 B
Rust
Raw Normal View History

2021-12-16 14:07:36 -06:00
// build-pass
2023-10-19 16:46:28 -05:00
#![feature(coroutines)]
2021-12-16 14:07:36 -06:00
#![allow(unused_assignments, dead_code)]
fn main() {
let _ = || {
let mut x = vec![22_usize];
std::mem::drop(x);
match y() {
true if {
x = vec![];
false
} => {}
_ => {
yield;
}
}
};
}
fn y() -> bool {
true
}