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

fn a() -> impl Fn(&u8) -> impl Debug + '_ {
    //~^ ERROR ambiguous `+` in a type
    //~| ERROR cannot capture higher-ranked lifetime from outer `impl Trait`
    |x| x
    //~^ ERROR lifetime may not live long enough
}

fn b() -> impl Fn() -> impl Debug + Send {
    //~^ ERROR ambiguous `+` in a type
    || ()
}

fn main() {}