11error[E0308]: mismatched types
2- --> $DIR/fn-item-type.rs:13 :19
2+ --> $DIR/fn-item-type.rs:22 :19
33 |
44LL | eq(foo::<u8>, bar::<u8>);
55 | -- ^^^^^^^^^ expected fn item, found a different fn item
@@ -8,17 +8,15 @@ LL | eq(foo::<u8>, bar::<u8>);
88 |
99 = note: expected fn item `fn(_) -> _ {foo::<u8>}`
1010 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`
11+ = note: different fn items have unique types, even if their signatures are the same
1412note: function defined here
15- --> $DIR/fn-item-type.rs:7 :4
13+ --> $DIR/fn-item-type.rs:11 :4
1614 |
17- LL | fn eq<T>(x: T, y: T) { }
15+ LL | fn eq<T>(x: T, y: T) {}
1816 | ^^ ----
1917
2018error[E0308]: mismatched types
21- --> $DIR/fn-item-type.rs:22 :19
19+ --> $DIR/fn-item-type.rs:29 :19
2220 |
2321LL | eq(foo::<u8>, foo::<i8>);
2422 | -- ^^^^^^^^^ expected `u8`, found `i8`
@@ -27,17 +25,15 @@ LL | eq(foo::<u8>, foo::<i8>);
2725 |
2826 = note: expected fn item `fn(_) -> _ {foo::<u8>}`
2927 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`
28+ = note: different fn items have unique types, even if their signatures are the same
3329note: function defined here
34- --> $DIR/fn-item-type.rs:7 :4
30+ --> $DIR/fn-item-type.rs:11 :4
3531 |
36- LL | fn eq<T>(x: T, y: T) { }
32+ LL | fn eq<T>(x: T, y: T) {}
3733 | ^^ ----
3834
3935error[E0308]: mismatched types
40- --> $DIR/fn-item-type.rs:29 :23
36+ --> $DIR/fn-item-type.rs:34 :23
4137 |
4238LL | eq(bar::<String>, bar::<Vec<u8>>);
4339 | -- ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
@@ -46,17 +42,15 @@ LL | eq(bar::<String>, bar::<Vec<u8>>);
4642 |
4743 = note: expected fn item `fn(_) -> _ {bar::<String>}`
4844 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`
45+ = note: different fn items have unique types, even if their signatures are the same
5246note: function defined here
53- --> $DIR/fn-item-type.rs:7 :4
47+ --> $DIR/fn-item-type.rs:11 :4
5448 |
55- LL | fn eq<T>(x: T, y: T) { }
49+ LL | fn eq<T>(x: T, y: T) {}
5650 | ^^ ----
5751
5852error[E0308]: mismatched types
59- --> $DIR/fn-item-type.rs:38 :26
53+ --> $DIR/fn-item-type.rs:41 :26
6054 |
6155LL | eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
6256 | -- ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
@@ -65,17 +59,15 @@ LL | eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
6559 |
6660 = note: expected fn item `fn() {<u8 as Foo>::foo}`
6761 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()`
62+ = note: different fn items have unique types, even if their signatures are the same
7163note: function defined here
72- --> $DIR/fn-item-type.rs:7 :4
64+ --> $DIR/fn-item-type.rs:11 :4
7365 |
74- LL | fn eq<T>(x: T, y: T) { }
66+ LL | fn eq<T>(x: T, y: T) {}
7567 | ^^ ----
7668
7769error[E0308]: mismatched types
78- --> $DIR/fn-item-type.rs:45 :19
70+ --> $DIR/fn-item-type.rs:46 :19
7971 |
8072LL | eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
8173 | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
@@ -84,12 +76,11 @@ LL | eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
8476 |
8577 = note: expected fn item `fn(_) -> _ {foo::<u8>}`
8678 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`
79+ = note: fn items are distinct from fn pointers
8980note: function defined here
90- --> $DIR/fn-item-type.rs:7 :4
81+ --> $DIR/fn-item-type.rs:11 :4
9182 |
92- LL | fn eq<T>(x: T, y: T) { }
83+ LL | fn eq<T>(x: T, y: T) {}
9384 | ^^ ----
9485
9586error: aborting due to 5 previous errors
0 commit comments