]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/yield-in-args-rev.rs
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[rust.git] / src / test / ui / generator / yield-in-args-rev.rs
1 // run-pass
2 #![allow(dead_code)]
3
4 // Test that a borrow that occurs after a yield in the same
5 // argument list is not treated as live across the yield by
6 // type-checking.
7
8 #![feature(generators)]
9
10 fn foo(_a: (), _b: &bool) {}
11
12 fn bar() {
13     || { //~ WARN unused generator that must be used
14         let b = true;
15         foo(yield, &b);
16     };
17 }
18
19 fn main() { }