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
391 B
Rust
Raw Normal View History

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