rust/tests/ui/generator/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-16 14:07:36 -06:00
// build-pass
#![feature(generators)]
#![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
}