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

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

26 lines
390 B
Rust
Raw Normal View History

2021-12-17 04:07:36 +08:00
// build-pass
2023-10-20 05:46:28 +08:00
#![feature(coroutines)]
2021-12-17 04:07:36 +08: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
}