]> git.proxmox.com Git - rustc.git/blame - src/test/ui/existential_types/different_defining_uses_never_type2.rs
New upstream version 1.37.0+dfsg1
[rustc.git] / src / test / ui / existential_types / different_defining_uses_never_type2.rs
CommitLineData
8faf50e0
XL
1// compile-pass
2
3#![feature(existential_type)]
4
5fn main() {}
6
7// two definitions with different types
8existential type Foo: std::fmt::Debug;
9
10fn foo() -> Foo {
11 ""
12}
13
14fn bar(arg: bool) -> Foo {
15 if arg {
16 panic!()
17 } else {
18 "bar"
19 }
20}
21
22fn boo(arg: bool) -> Foo {
23 if arg {
24 loop {}
25 } else {
26 "boo"
27 }
28}
29
30fn bar2(arg: bool) -> Foo {
31 if arg {
32 "bar2"
33 } else {
34 panic!()
35 }
36}
37
38fn boo2(arg: bool) -> Foo {
39 if arg {
40 "boo2"
41 } else {
42 loop {}
43 }
44}