about summary refs log tree commit diff
path: root/tests/ui/lazy-type-alias-impl-trait/recursion2.rs
blob: b28a95c53f4815594cd8b301e2b1c738d6aa2159 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#![feature(type_alias_impl_trait)]

//@ check-pass

type Foo = impl std::fmt::Debug;

#[define_opaque(Foo)]
fn foo(b: bool) -> Foo {
    if b {
        return vec![];
    }
    let x: Vec<i32> = foo(false);
    std::iter::empty().collect()
}

fn bar(b: bool) -> impl std::fmt::Debug {
    if b {
        return vec![];
    }
    let x: Vec<i32> = bar(false);
    std::iter::empty().collect()
}

fn main() {}