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

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