]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/two_tait_defining_each_other.rs
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / impl-trait / two_tait_defining_each_other.rs
1 #![feature(type_alias_impl_trait)]
2
3 type A = impl Foo;
4 type B = impl Foo;
5
6 trait Foo {}
7
8 fn muh(x: A) -> B {
9     if false {
10         return Bar; // B's hidden type is Bar
11     }
12     x // A's hidden type is `Bar`, because all the hidden types of `B` are compared with each other
13     //~^ ERROR opaque type's hidden type cannot be another opaque type
14 }
15
16 struct Bar;
17 impl Foo for Bar {}
18
19 fn main() {}