]>
git.proxmox.com Git - rustc.git/blob - tests/ui/lifetimes/issue-79187-2.rs
3 impl<F
> Foo
for F
where F
: Fn(&i32) -> &i32 {}
5 fn take_foo(_
: impl Foo
) {}
9 //~^ ERROR implementation of `FnOnce` is not general enough
10 //~| ERROR mismatched types
11 take_foo(|a
: &i32| a
);
12 //~^ ERROR lifetime may not live long enough
13 //~| ERROR mismatched types
14 take_foo(|a
: &i32| -> &i32 { a }
);
15 //~^ ERROR lifetime may not live long enough
16 //~| ERROR mismatched types
19 take_foo(identity(|a
| a
));
20 take_foo(identity(|a
: &i32| a
));
21 take_foo(identity(|a
: &i32| -> &i32 { a }
));
23 fn identity
<F
>(t
: F
) -> F