2018-09-06 07:41:12 -05:00
|
|
|
// run-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(dead_code)]
|
2018-09-06 07:41:12 -05:00
|
|
|
|
2017-09-20 08:36:20 -05: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.
|
|
|
|
|
2023-10-19 16:46:28 -05:00
|
|
|
#![feature(coroutines)]
|
2017-07-14 18:11:21 -05:00
|
|
|
|
|
|
|
fn foo(_a: (), _b: &bool) {}
|
|
|
|
|
|
|
|
fn bar() {
|
2023-10-19 16:46:28 -05:00
|
|
|
|| { //~ WARN unused coroutine that must be used
|
2017-07-15 14:28:42 -05:00
|
|
|
let b = true;
|
2017-09-03 05:43:05 -05:00
|
|
|
foo(yield, &b);
|
2017-07-15 14:28:42 -05:00
|
|
|
};
|
2017-07-14 18:11:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|