]> git.proxmox.com Git - rustc.git/blame - src/test/ui/fn/fn-item-type.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / fn / fn-item-type.stderr
CommitLineData
b7449926 1error[E0308]: mismatched types
0731742a 2 --> $DIR/fn-item-type.rs:13:19
b7449926
XL
3 |
4LL | eq(foo::<u8>, bar::<u8>);
923072b8
FG
5 | -- ^^^^^^^^^ expected fn item, found a different fn item
6 | |
7 | arguments to this function are incorrect
b7449926 8 |
60c5eb7d
XL
9 = note: expected fn item `fn(_) -> _ {foo::<u8>}`
10 found fn item `fn(_) -> _ {bar::<u8>}`
f035d41b
XL
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`
923072b8
FG
14note: function defined here
15 --> $DIR/fn-item-type.rs:7:4
16 |
17LL | fn eq<T>(x: T, y: T) { }
18 | ^^ ---- ----
b7449926
XL
19
20error[E0308]: mismatched types
f035d41b 21 --> $DIR/fn-item-type.rs:22:19
b7449926
XL
22 |
23LL | eq(foo::<u8>, foo::<i8>);
923072b8
FG
24 | -- ^^^^^^^^^ expected `u8`, found `i8`
25 | |
26 | arguments to this function are incorrect
b7449926 27 |
60c5eb7d
XL
28 = note: expected fn item `fn(_) -> _ {foo::<u8>}`
29 found fn item `fn(_) -> _ {foo::<i8>}`
f035d41b
XL
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`
923072b8
FG
33note: function defined here
34 --> $DIR/fn-item-type.rs:7:4
35 |
36LL | fn eq<T>(x: T, y: T) { }
37 | ^^ ---- ----
b7449926
XL
38
39error[E0308]: mismatched types
f035d41b 40 --> $DIR/fn-item-type.rs:29:23
b7449926
XL
41 |
42LL | eq(bar::<String>, bar::<Vec<u8>>);
923072b8
FG
43 | -- ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
44 | |
45 | arguments to this function are incorrect
b7449926 46 |
1b1a35ee
XL
47 = note: expected fn item `fn(_) -> _ {bar::<String>}`
48 found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
f035d41b
XL
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`
1b1a35ee 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`
923072b8
FG
52note: function defined here
53 --> $DIR/fn-item-type.rs:7:4
54 |
55LL | fn eq<T>(x: T, y: T) { }
56 | ^^ ---- ----
b7449926
XL
57
58error[E0308]: mismatched types
04454e1e 59 --> $DIR/fn-item-type.rs:38:26
b7449926
XL
60 |
61LL | eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
923072b8
FG
62 | -- ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
63 | |
64 | arguments to this function are incorrect
b7449926 65 |
60c5eb7d
XL
66 = note: expected fn item `fn() {<u8 as Foo>::foo}`
67 found fn item `fn() {<u16 as Foo>::foo}`
f035d41b
XL
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()`
923072b8
FG
71note: function defined here
72 --> $DIR/fn-item-type.rs:7:4
73 |
74LL | fn eq<T>(x: T, y: T) { }
75 | ^^ ---- ----
b7449926 76
f035d41b 77error[E0308]: mismatched types
04454e1e 78 --> $DIR/fn-item-type.rs:45:19
f035d41b
XL
79 |
80LL | eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
923072b8
FG
81 | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
82 | |
83 | arguments to this function are incorrect
f035d41b
XL
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`
923072b8
FG
89note: function defined here
90 --> $DIR/fn-item-type.rs:7:4
91 |
92LL | fn eq<T>(x: T, y: T) { }
93 | ^^ ---- ----
f035d41b
XL
94
95error: aborting due to 5 previous errors
b7449926
XL
96
97For more information about this error, try `rustc --explain E0308`.