]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.rs
Auto merge of #106171 - compiler-errors:consolidate-extract_callable_info, r=estebank...
[rust.git] / tests / ui / impl-trait / recursive-type-alias-impl-trait-declaration-too-subtle.rs
1 #![feature(type_alias_impl_trait)]
2
3 mod a {
4     type Foo = impl PartialEq<(Foo, i32)>;
5     //~^ ERROR: unconstrained opaque type
6
7     struct Bar;
8
9     impl PartialEq<(Bar, i32)> for Bar {
10         fn eq(&self, _other: &(Foo, i32)) -> bool {
11             //~^ ERROR: `eq` has an incompatible type for trait
12             true
13         }
14     }
15 }
16
17 mod b {
18     type Foo = impl PartialEq<(Foo, i32)>;
19     //~^ ERROR: unconstrained opaque type
20
21     struct Bar;
22
23     impl PartialEq<(Foo, i32)> for Bar {
24         fn eq(&self, _other: &(Bar, i32)) -> bool {
25             //~^ ERROR: `eq` has an incompatible type for trait
26             true
27         }
28     }
29 }
30
31 fn main() {}