]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / impl-trait / recursive-type-alias-impl-trait-declaration-too-subtle.stderr
1 error: unconstrained opaque type
2   --> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:4:16
3    |
4 LL |     type Foo = impl PartialEq<(Foo, i32)>;
5    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `Foo` must be used in combination with a concrete type within the same module
8
9 error[E0053]: method `eq` has an incompatible type for trait
10   --> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:10:30
11    |
12 LL |     type Foo = impl PartialEq<(Foo, i32)>;
13    |                -------------------------- the found opaque type
14 ...
15 LL |         fn eq(&self, _other: &(Foo, i32)) -> bool {
16    |                              ^^^^^^^^^^^
17    |                              |
18    |                              expected struct `Bar`, found opaque type
19    |                              help: change the parameter type to match the trait: `&(a::Bar, i32)`
20    |
21    = note: expected signature `fn(&a::Bar, &(a::Bar, i32)) -> _`
22               found signature `fn(&a::Bar, &(a::Foo, i32)) -> _`
23
24 error: unconstrained opaque type
25   --> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:18:16
26    |
27 LL |     type Foo = impl PartialEq<(Foo, i32)>;
28    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^
29    |
30    = note: `Foo` must be used in combination with a concrete type within the same module
31
32 error[E0053]: method `eq` has an incompatible type for trait
33   --> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:24:30
34    |
35 LL |     type Foo = impl PartialEq<(Foo, i32)>;
36    |                -------------------------- the expected opaque type
37 ...
38 LL |         fn eq(&self, _other: &(Bar, i32)) -> bool {
39    |                              ^^^^^^^^^^^
40    |                              |
41    |                              expected opaque type, found struct `Bar`
42    |                              help: change the parameter type to match the trait: `&(b::Foo, i32)`
43    |
44    = note: expected signature `fn(&b::Bar, &(b::Foo, i32)) -> _`
45               found signature `fn(&b::Bar, &(b::Bar, i32)) -> _`
46
47 error: aborting due to 4 previous errors
48
49 For more information about this error, try `rustc --explain E0053`.