File: associated-types-multiple-types-one-trait.stderr

package info (click to toggle)
rustc-web 1.85.0%2Bdfsg3-1~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,759,988 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,056; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (43 lines) | stat: -rw-r--r-- 1,594 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
  --> $DIR/associated-types-multiple-types-one-trait.rs:13:12
   |
LL |     want_y(t);
   |     ------ ^ expected `i32`, found associated type
   |     |
   |     required by a bound introduced by this call
   |
   = note:         expected type `i32`
           found associated type `<T as Foo>::Y`
note: required by a bound in `want_y`
  --> $DIR/associated-types-multiple-types-one-trait.rs:44:17
   |
LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
   |                 ^^^^^ required by this bound in `want_y`
help: consider constraining the associated type `<T as Foo>::Y` to `i32`
   |
LL | fn have_x_want_y<T:Foo<X=u32, Y = i32>>(t: &T)
   |                             +++++++++

error[E0271]: type mismatch resolving `<T as Foo>::X == u32`
  --> $DIR/associated-types-multiple-types-one-trait.rs:18:12
   |
LL |     want_x(t);
   |     ------ ^ expected `u32`, found associated type
   |     |
   |     required by a bound introduced by this call
   |
   = note:         expected type `u32`
           found associated type `<T as Foo>::X`
note: required by a bound in `want_x`
  --> $DIR/associated-types-multiple-types-one-trait.rs:42:17
   |
LL | fn want_x<T:Foo<X=u32>>(t: &T) { }
   |                 ^^^^^ required by this bound in `want_x`
help: consider constraining the associated type `<T as Foo>::X` to `u32`
   |
LL | fn have_y_want_x<T:Foo<Y=i32, X = u32>>(t: &T)
   |                             +++++++++

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0271`.