]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/yield-in-args-rev.rs
Sync core::simd up to rust-lang/portable-simd@2e081db92aa3ee0a4563bc28ce01bdad5b1b2efd
[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() { }