summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issue-87450.rs
blob: 983ef7cfbe0af83f21bc90abddd69de5cc6b74ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn bar() -> impl Fn() {
    wrap(wrap(wrap(wrap(foo()))))
}

fn foo() -> impl Fn() {
    //~^ WARNING 5:1: 5:22: function cannot return without recursing [unconditional_recursion]
    //~| ERROR 5:13: 5:22: cannot resolve opaque type [E0720]
    wrap(wrap(wrap(wrap(wrap(wrap(wrap(foo())))))))
}

fn wrap(f: impl Fn()) -> impl Fn() {
    move || f()
}

fn main() {
}