]> git.lizzy.rs Git - rust.git/blob - tests/ui/generator/reinit-in-match-guard.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / generator / reinit-in-match-guard.rs
1 // build-pass
2
3 #![feature(generators)]
4
5 #![allow(unused_assignments, dead_code)]
6
7 fn main() {
8     let _ = || {
9         let mut x = vec![22_usize];
10         std::mem::drop(x);
11         match y() {
12             true if {
13                 x = vec![];
14                 false
15             } => {}
16             _ => {
17                 yield;
18             }
19         }
20     };
21 }
22
23 fn y() -> bool {
24     true
25 }