]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associated-types-eq-3.stderr
Auto merge of #106143 - matthiaskrgr:rollup-3kpy1dc, r=matthiaskrgr
[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:10
18    |
19 LL |     foo1(a);
20    |     ---- ^ type mismatch resolving `<isize as Foo>::A == Bar`
21    |     |
22    |     required by a bound introduced by this call
23    |
24 note: expected this to be `Bar`
25   --> $DIR/associated-types-eq-3.rs:12:14
26    |
27 LL |     type A = usize;
28    |              ^^^^^
29 note: required by a bound in `foo1`
30   --> $DIR/associated-types-eq-3.rs:18:16
31    |
32 LL | fn foo1<I: Foo<A=Bar>>(x: I) {
33    |                ^^^^^ required by this bound in `foo1`
34
35 error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
36   --> $DIR/associated-types-eq-3.rs:40:9
37    |
38 LL |     baz(&a);
39    |         ^^ type mismatch resolving `<isize as Foo>::A == Bar`
40    |
41 note: expected this to be `Bar`
42   --> $DIR/associated-types-eq-3.rs:12:14
43    |
44 LL |     type A = usize;
45    |              ^^^^^
46    = note: required for the cast from `isize` to the object type `dyn Foo<A = Bar>`
47
48 error: aborting due to 3 previous errors
49
50 Some errors have detailed explanations: E0271, E0308.
51 For more information about an error, try `rustc --explain E0271`.