]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fn/fn-item-type.stderr
Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyup
[rust.git] / src / test / ui / fn / fn-item-type.stderr
1 error[E0308]: mismatched types
2   --> $DIR/fn-item-type.rs:13:19
3    |
4 LL |     eq(foo::<u8>, bar::<u8>);
5    |                   ^^^^^^^^^ expected fn item, found a different fn item
6    |
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`
12
13 error[E0308]: mismatched types
14   --> $DIR/fn-item-type.rs:22:19
15    |
16 LL |     eq(foo::<u8>, foo::<i8>);
17    |                   ^^^^^^^^^ expected `u8`, found `i8`
18    |
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`
24
25 error[E0308]: mismatched types
26   --> $DIR/fn-item-type.rs:29:23
27    |
28 LL |     eq(bar::<String>, bar::<Vec<u8>>);
29    |                       ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
30    |
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`
36
37 error[E0308]: mismatched types
38   --> $DIR/fn-item-type.rs:39:26
39    |
40 LL |     eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
41    |                          ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
42    |
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()`
48
49 error[E0308]: mismatched types
50   --> $DIR/fn-item-type.rs:46:19
51    |
52 LL |     eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
53    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
54    |
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`
59
60 error: aborting due to 5 previous errors
61
62 For more information about this error, try `rustc --explain E0308`.