about summary refs log tree commit diff
path: root/tests/ui/impl-trait/impl-fn-predefined-lifetimes.rs
blob: 2f17c0ff50861a2d994845f7e87c1e714059ebc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![feature(impl_trait_in_fn_trait_return)]
use std::fmt::Debug;

fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
    //~^ ERROR cannot resolve opaque type
    //~| WARNING elided lifetime has a name
    |x| x
    //~^ ERROR expected generic lifetime parameter, found `'_`
}

fn _b<'a>() -> impl Fn(&'a u8) -> (impl Debug + 'a) {
    a()
}

fn main() {}