summaryrefslogtreecommitdiffstats
path: root/tests/ui/fn/fn-item-type.stderr
blob: f03a47d5c2c75c4727ba65d9685265b190159a0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
error[E0308]: mismatched types
  --> $DIR/fn-item-type.rs:13:19
   |
LL |     eq(foo::<u8>, bar::<u8>);
   |     --            ^^^^^^^^^ expected fn item, found a different fn item
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected fn item `fn(_) -> _ {foo::<u8>}`
              found fn item `fn(_) -> _ {bar::<u8>}`
   = note: different `fn` items always have unique types, even if their signatures are the same
   = help: change the expected type to be function pointer `fn(isize) -> isize`
   = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
note: function defined here
  --> $DIR/fn-item-type.rs:7:4
   |
LL | fn eq<T>(x: T, y: T) { }
   |    ^^          ----

error[E0308]: mismatched types
  --> $DIR/fn-item-type.rs:22:19
   |
LL |     eq(foo::<u8>, foo::<i8>);
   |     --            ^^^^^^^^^ expected `u8`, found `i8`
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected fn item `fn(_) -> _ {foo::<u8>}`
              found fn item `fn(_) -> _ {foo::<i8>}`
   = note: different `fn` items always have unique types, even if their signatures are the same
   = help: change the expected type to be function pointer `fn(isize) -> isize`
   = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
note: function defined here
  --> $DIR/fn-item-type.rs:7:4
   |
LL | fn eq<T>(x: T, y: T) { }
   |    ^^          ----

error[E0308]: mismatched types
  --> $DIR/fn-item-type.rs:29:23
   |
LL |     eq(bar::<String>, bar::<Vec<u8>>);
   |     --                ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected fn item `fn(_) -> _ {bar::<String>}`
              found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
   = note: different `fn` items always have unique types, even if their signatures are the same
   = help: change the expected type to be function pointer `fn(isize) -> isize`
   = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `bar::<String> as fn(isize) -> isize`
note: function defined here
  --> $DIR/fn-item-type.rs:7:4
   |
LL | fn eq<T>(x: T, y: T) { }
   |    ^^          ----

error[E0308]: mismatched types
  --> $DIR/fn-item-type.rs:38:26
   |
LL |     eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
   |     --                   ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected fn item `fn() {<u8 as Foo>::foo}`
              found fn item `fn() {<u16 as Foo>::foo}`
   = note: different `fn` items always have unique types, even if their signatures are the same
   = help: change the expected type to be function pointer `fn()`
   = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `<u8 as Foo>::foo as fn()`
note: function defined here
  --> $DIR/fn-item-type.rs:7:4
   |
LL | fn eq<T>(x: T, y: T) { }
   |    ^^          ----

error[E0308]: mismatched types
  --> $DIR/fn-item-type.rs:45:19
   |
LL |     eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
   |     --            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected fn item `fn(_) -> _ {foo::<u8>}`
           found fn pointer `fn(_) -> _`
   = help: change the expected type to be function pointer `fn(isize) -> isize`
   = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
note: function defined here
  --> $DIR/fn-item-type.rs:7:4
   |
LL | fn eq<T>(x: T, y: T) { }
   |    ^^          ----

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0308`.