]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lazy-type-alias-impl-trait/recursion3.rs
Rollup merge of #100479 - compiler-errors:argument-type-error-improvements, r=lcnr
[rust.git] / src / test / ui / lazy-type-alias-impl-trait / recursion3.rs
1 #![feature(type_alias_impl_trait)]
2
3 type Foo = impl std::fmt::Debug;
4
5 fn foo(b: bool) -> Foo {
6     if b {
7         return 42
8     }
9     let x: u32 = foo(false) + 42; //~ ERROR cannot add
10     99
11 }
12
13 fn bar(b: bool) -> impl std::fmt::Debug {
14     if b {
15         return 42
16     }
17     let x: u32 = bar(false) + 42; //~ ERROR cannot add
18     99
19 }
20
21 fn main() {}