1 error[E0308]: mismatched types
2 --> $DIR/fn-item-type.rs:13:19
4 LL | eq(foo::<u8>, bar::<u8>);
5 | -- ^^^^^^^^^ expected fn item, found a different fn item
7 | arguments to this function are incorrect
9 = note: expected fn item `fn(_) -> _ {foo::<u8>}`
10 found fn item `fn(_) -> _ {bar::<u8>}`
11 = note: different `fn` items always have unique types, even if their signatures are the same
12 = help: change the expected type to be function pointer `fn(isize) -> isize`
13 = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
14 note: function defined here
15 --> $DIR/fn-item-type.rs:7:4
17 LL | fn eq<T>(x: T, y: T) { }
20 error[E0308]: mismatched types
21 --> $DIR/fn-item-type.rs:22:19
23 LL | eq(foo::<u8>, foo::<i8>);
24 | -- ^^^^^^^^^ expected `u8`, found `i8`
26 | arguments to this function are incorrect
28 = note: expected fn item `fn(_) -> _ {foo::<u8>}`
29 found fn item `fn(_) -> _ {foo::<i8>}`
30 = note: different `fn` items always have unique types, even if their signatures are the same
31 = help: change the expected type to be function pointer `fn(isize) -> isize`
32 = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
33 note: function defined here
34 --> $DIR/fn-item-type.rs:7:4
36 LL | fn eq<T>(x: T, y: T) { }
39 error[E0308]: mismatched types
40 --> $DIR/fn-item-type.rs:29:23
42 LL | eq(bar::<String>, bar::<Vec<u8>>);
43 | -- ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
45 | arguments to this function are incorrect
47 = note: expected fn item `fn(_) -> _ {bar::<String>}`
48 found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
49 = note: different `fn` items always have unique types, even if their signatures are the same
50 = help: change the expected type to be function pointer `fn(isize) -> isize`
51 = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `bar::<String> as fn(isize) -> isize`
52 note: function defined here
53 --> $DIR/fn-item-type.rs:7:4
55 LL | fn eq<T>(x: T, y: T) { }
58 error[E0308]: mismatched types
59 --> $DIR/fn-item-type.rs:38:26
61 LL | eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
62 | -- ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
64 | arguments to this function are incorrect
66 = note: expected fn item `fn() {<u8 as Foo>::foo}`
67 found fn item `fn() {<u16 as Foo>::foo}`
68 = note: different `fn` items always have unique types, even if their signatures are the same
69 = help: change the expected type to be function pointer `fn()`
70 = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `<u8 as Foo>::foo as fn()`
71 note: function defined here
72 --> $DIR/fn-item-type.rs:7:4
74 LL | fn eq<T>(x: T, y: T) { }
77 error[E0308]: mismatched types
78 --> $DIR/fn-item-type.rs:45:19
80 LL | eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
81 | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
83 | arguments to this function are incorrect
85 = note: expected fn item `fn(_) -> _ {foo::<u8>}`
86 found fn pointer `fn(_) -> _`
87 = help: change the expected type to be function pointer `fn(isize) -> isize`
88 = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
89 note: function defined here
90 --> $DIR/fn-item-type.rs:7:4
92 LL | fn eq<T>(x: T, y: T) { }
95 error: aborting due to 5 previous errors
97 For more information about this error, try `rustc --explain E0308`.