]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fn/fn-item-type.stderr
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
[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    |     arguments to this function are incorrect
8    |
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
16    |
17 LL | fn eq<T>(x: T, y: T) { }
18    |    ^^          ----
19
20 error[E0308]: mismatched types
21   --> $DIR/fn-item-type.rs:22:19
22    |
23 LL |     eq(foo::<u8>, foo::<i8>);
24    |     --            ^^^^^^^^^ expected `u8`, found `i8`
25    |     |
26    |     arguments to this function are incorrect
27    |
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
35    |
36 LL | fn eq<T>(x: T, y: T) { }
37    |    ^^          ----
38
39 error[E0308]: mismatched types
40   --> $DIR/fn-item-type.rs:29:23
41    |
42 LL |     eq(bar::<String>, bar::<Vec<u8>>);
43    |     --                ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
44    |     |
45    |     arguments to this function are incorrect
46    |
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
54    |
55 LL | fn eq<T>(x: T, y: T) { }
56    |    ^^          ----
57
58 error[E0308]: mismatched types
59   --> $DIR/fn-item-type.rs:38:26
60    |
61 LL |     eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
62    |     --                   ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
63    |     |
64    |     arguments to this function are incorrect
65    |
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
73    |
74 LL | fn eq<T>(x: T, y: T) { }
75    |    ^^          ----
76
77 error[E0308]: mismatched types
78   --> $DIR/fn-item-type.rs:45:19
79    |
80 LL |     eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
81    |     --            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
82    |     |
83    |     arguments to this function are incorrect
84    |
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
91    |
92 LL | fn eq<T>(x: T, y: T) { }
93    |    ^^          ----
94
95 error: aborting due to 5 previous errors
96
97 For more information about this error, try `rustc --explain E0308`.