]> git.lizzy.rs Git - rust.git/blob - src/test/ui/point-to-type-err-cause-on-impl-trait-return.rs
Auto merge of #62748 - luca-barbieri:optimize-refcell-borrow, r=RalfJung
[rust.git] / src / test / ui / point-to-type-err-cause-on-impl-trait-return.rs
1 fn foo() -> impl std::fmt::Display {
2     if false {
3         return 0i32;
4     }
5     1u32
6     //~^ ERROR mismatched types
7 }
8
9 fn bar() -> impl std::fmt::Display {
10     if false {
11         return 0i32;
12     } else {
13         return 1u32;
14         //~^ ERROR mismatched types
15     }
16 }
17
18 fn baz() -> impl std::fmt::Display {
19     if false {
20     //~^ ERROR mismatched types
21         return 0i32;
22     } else {
23         1u32
24     }
25 }
26
27 fn qux() -> impl std::fmt::Display {
28     if false {
29         0i32
30     } else {
31         1u32
32         //~^ ERROR if and else have incompatible types
33     }
34 }
35
36 fn main() {}