2018-09-06 12:41:12 +00:00
|
|
|
// run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(dead_code)]
|
2018-09-06 12:41:12 +00:00
|
|
|
|
2017-09-20 13:36:20 +00:00
|
|
|
// Test that a borrow that occurs after a yield in the same
|
|
|
|
// argument list is not treated as live across the yield by
|
|
|
|
// type-checking.
|
|
|
|
|
2017-07-14 23:11:21 +00:00
|
|
|
#![feature(generators)]
|
|
|
|
|
|
|
|
fn foo(_a: (), _b: &bool) {}
|
|
|
|
|
|
|
|
fn bar() {
|
2020-07-28 00:00:00 +00:00
|
|
|
|| { //~ WARN unused generator that must be used
|
2017-07-15 19:28:42 +00:00
|
|
|
let b = true;
|
2017-09-03 10:43:05 +00:00
|
|
|
foo(yield, &b);
|
2017-07-15 19:28:42 +00:00
|
|
|
};
|
2017-07-14 23:11:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|