]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associated-types-eq-3.stderr
Rollup merge of #76468 - SNCPlay42:lifetime-names, r=Mark-Simulacrum
[rust.git] / src / test / ui / associated-types / associated-types-eq-3.stderr
1 error[E0308]: mismatched types
2   --> $DIR/associated-types-eq-3.rs:23:18
3    |
4 LL |     let _: Bar = x.boo();
5    |            ---   ^^^^^^^ expected struct `Bar`, found associated type
6    |            |
7    |            expected due to this
8    |
9    = note:       expected struct `Bar`
10            found associated type `<I as Foo>::A`
11 help: consider constraining the associated type `<I as Foo>::A` to `Bar`
12    |
13 LL | fn foo2<I: Foo<A = Bar>>(x: I) {
14    |               ^^^^^^^^^
15
16 error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
17   --> $DIR/associated-types-eq-3.rs:38:5
18    |
19 LL | fn foo1<I: Foo<A=Bar>>(x: I) {
20    |                ----- required by this bound in `foo1`
21 ...
22 LL |     foo1(a);
23    |     ^^^^ expected struct `Bar`, found `usize`
24
25 error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
26   --> $DIR/associated-types-eq-3.rs:41:9
27    |
28 LL |     baz(&a);
29    |         ^^ expected struct `Bar`, found `usize`
30    |
31    = note: required for the cast to the object type `dyn Foo<A = Bar>`
32
33 error: aborting due to 3 previous errors
34
35 Some errors have detailed explanations: E0271, E0308.
36 For more information about an error, try `rustc --explain E0271`.