]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-52534.rs
1394560df19ba295fbdfb6f15fb1c9cd6d5ad579
[rust.git] / src / test / ui / nll / issue-52534.rs
1 #![feature(nll)]
2 #![allow(warnings)]
3
4 fn foo(_: impl FnOnce(&u32) -> &u32) {
5 }
6
7 fn baz(_: impl FnOnce(&u32, u32) -> &u32) {
8 }
9
10 fn bar() {
11     let x = 22;
12     foo(|a| &x)
13 //~^ ERROR does not live long enough
14 }
15
16 fn foobar() {
17     let y = 22;
18     baz(|first, second| &y)
19 //~^ ERROR does not live long enough
20 }
21
22 fn main() { }