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 = note: expected fn item `fn(_) -> _ {foo::<u8>}`
8 found fn item `fn(_) -> _ {bar::<u8>}`
9 = note: different `fn` items always have unique types, even if their signatures are the same
10 = help: change the expected type to be function pointer `fn(isize) -> isize`
11 = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
13 error[E0308]: mismatched types
14 --> $DIR/fn-item-type.rs:22:19
16 LL | eq(foo::<u8>, foo::<i8>);
17 | ^^^^^^^^^ expected `u8`, found `i8`
19 = note: expected fn item `fn(_) -> _ {foo::<u8>}`
20 found fn item `fn(_) -> _ {foo::<i8>}`
21 = note: different `fn` items always have unique types, even if their signatures are the same
22 = help: change the expected type to be function pointer `fn(isize) -> isize`
23 = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
25 error[E0308]: mismatched types
26 --> $DIR/fn-item-type.rs:29:23
28 LL | eq(bar::<String>, bar::<Vec<u8>>);
29 | ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
31 = note: expected fn item `fn(_) -> _ {bar::<String>}`
32 found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
33 = note: different `fn` items always have unique types, even if their signatures are the same
34 = help: change the expected type to be function pointer `fn(isize) -> isize`
35 = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `bar::<String> as fn(isize) -> isize`
37 error[E0308]: mismatched types
38 --> $DIR/fn-item-type.rs:39:26
40 LL | eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
41 | ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
43 = note: expected fn item `fn() {<u8 as Foo>::foo}`
44 found fn item `fn() {<u16 as Foo>::foo}`
45 = note: different `fn` items always have unique types, even if their signatures are the same
46 = help: change the expected type to be function pointer `fn()`
47 = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `<u8 as Foo>::foo as fn()`
49 error[E0308]: mismatched types
50 --> $DIR/fn-item-type.rs:46:19
52 LL | eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
53 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
55 = note: expected fn item `fn(_) -> _ {foo::<u8>}`
56 found fn pointer `fn(_) -> _`
57 = help: change the expected type to be function pointer `fn(isize) -> isize`
58 = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
60 error: aborting due to 5 previous errors
62 For more information about this error, try `rustc --explain E0308`.