]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/issue-52534.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / nll / issue-52534.rs
1 fn foo(_: impl FnOnce(&u32) -> &u32) {
2 }
3
4 fn baz(_: impl FnOnce(&u32, u32) -> &u32) {
5 }
6
7 fn bar() {
8 let x = 22;
9 foo(|a| &x)
10 //~^ ERROR does not live long enough
11 }
12
13 fn foobar() {
14 let y = 22;
15 baz(|first, second| &y)
16 //~^ ERROR does not live long enough
17 }
18
19 fn main() { }