]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/impl-fn-hrtb-bounds.rs
Resolve lifetimes using the regular logic for RPIT.
[rust.git] / src / test / ui / impl-trait / impl-fn-hrtb-bounds.rs
1 #![feature(impl_trait_in_fn_trait_return)]
2 use std::fmt::Debug;
3
4 fn a() -> impl Fn(&u8) -> (impl Debug + '_) {
5     //~^ ERROR higher kinded lifetime bounds on nested opaque types are not supported yet
6     |x| x
7     //~^ ERROR lifetime may not live long enough
8 }
9
10 fn b() -> impl for<'a> Fn(&'a u8) -> (impl Debug + 'a) {
11     //~^ ERROR higher kinded lifetime bounds on nested opaque types are not supported yet
12     |x| x
13     //~^ ERROR lifetime may not live long enough
14 }
15
16 fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) {
17     //~^ ERROR higher kinded lifetime bounds on nested opaque types are not supported yet
18     |x| x
19     //~^ ERROR lifetime may not live long enough
20 }
21
22 fn d() -> impl Fn() -> (impl Debug + '_) {
23     //~^ ERROR missing lifetime specifier
24     || ()
25 }
26
27 fn main() {}