]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.rs
Rollup merge of #94817 - cuviper:relnotes-1.60.0, r=pietroalbini,m-ou-se
[rust.git] / src / test / 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             true
12         }
13     }
14 }
15
16 mod b {
17     type Foo = impl PartialEq<(Foo, i32)>;
18     //~^ ERROR unconstrained opaque type
19
20     struct Bar;
21
22     impl PartialEq<(Foo, i32)> for Bar {
23         fn eq(&self, _other: &(Bar, i32)) -> bool {
24             //~^ ERROR impl has stricter requirements than trait
25             true
26         }
27     }
28 }
29
30 fn main() {}