1 error[E0597]: `x` does not live long enough
2 --> $DIR/issue-52534.rs:9:14
5 | - ^ `x` would have to be valid for `'0`...
10 | - ...but `x` will be dropped here, when the function `bar` returns
12 = note: functions cannot return a borrow to data owned within the function's scope, functions can only return borrows to data passed as arguments
13 = note: to learn more, visit <https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#dangling-references>
15 error[E0597]: `y` does not live long enough
16 --> $DIR/issue-52534.rs:15:26
18 LL | baz(|first, second| &y)
19 | ----- ^ `y` would have to be valid for `'0`...
24 | - ...but `y` will be dropped here, when the function `foobar` returns
26 = note: functions cannot return a borrow to data owned within the function's scope, functions can only return borrows to data passed as arguments
27 = note: to learn more, visit <https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#dangling-references>
29 error: aborting due to 2 previous errors
31 For more information about this error, try `rustc --explain E0597`.