summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lazy-type-alias-impl-trait/recursion3.rs
blob: 7f1cedae068f02770721c8c190a4564c07c1cdc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![feature(type_alias_impl_trait)]

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

fn foo(b: bool) -> Foo {
    if b {
        return 42
    }
    let x: u32 = foo(false) + 42; //~ ERROR cannot add
    99
}

fn bar(b: bool) -> impl std::fmt::Debug {
    if b {
        return 42
    }
    let x: u32 = bar(false) + 42; //~ ERROR cannot add
    99
}

fn main() {}