]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/yield-in-box.rs
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / ui / generator / yield-in-box.rs
1 // run-pass
2
3 // Test that box-statements with yields in them work.
4
5 #![feature(generators, box_syntax)]
6
7 fn main() {
8     let x = 0i32;
9     || { //~ WARN unused generator that must be used
10         let y = 2u32;
11         {
12             let _t = box (&x, yield 0, &y);
13         }
14         match box (&x, yield 0, &y) {
15             _t => {}
16         }
17     };
18 }