]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associated-types-eq-3.stderr
88910f6de2a3a49688eed8f8940e19c9febaef21
[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    = note:       expected struct `Bar`
8            found associated type `<I as Foo>::A`
9    = note: consider constraining the associated type `<I as Foo>::A` to `Bar`
10    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
11
12 error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
13   --> $DIR/associated-types-eq-3.rs:38:5
14    |
15 LL | fn foo1<I: Foo<A=Bar>>(x: I) {
16    |    ----        ----- required by this bound in `foo1`
17 ...
18 LL |     foo1(a);
19    |     ^^^^ expected struct `Bar`, found usize
20    |
21    = note: expected struct `Bar`
22                 found type `usize`
23
24 error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
25   --> $DIR/associated-types-eq-3.rs:41:9
26    |
27 LL |     baz(&a);
28    |         ^^ expected struct `Bar`, found usize
29    |
30    = note: expected struct `Bar`
31                 found type `usize`
32    = note: required for the cast to the object type `dyn Foo<A = Bar>`
33
34 error: aborting due to 3 previous errors
35
36 Some errors have detailed explanations: E0271, E0308.
37 For more information about an error, try `rustc --explain E0271`.