error[[E0277]](https://doc.rust-lang.org/nightly/error-index.html#E0277): can't compare `fn() {f}` with `fn() {f}`
--> src/main.rs:7:10
|
7 | take(f);
| ---- ^ no implementation for `fn() {f} == fn() {f}`
| |
| required by a bound introduced by this call
|
= help: the trait `PartialEq` is not implemented for `fn() {f}`
= help: the following other types implement trait `PartialEq<Rhs>`:
extern "C" fn() -> Ret
extern "C" fn(A, B) -> Ret
extern "C" fn(A, B, ...) -> Ret
extern "C" fn(A, B, C) -> Ret
extern "C" fn(A, B, C, ...) -> Ret
extern "C" fn(A, B, C, D) -> Ret
extern "C" fn(A, B, C, D, ...) -> Ret
extern "C" fn(A, B, C, D, E) -> Ret
and 68 others
note: required because of the requirements on the impl of `Trait` for `fn() {f}`
--> src/main.rs:2:20
|
2 | impl<A: PartialEq> Trait for A {}
| ^^^^^ ^
note: required by a bound in `take`
--> src/main.rs:3:17
|
3 | fn take(_: impl Trait) {}
| ^^^^^ required by this bound in `take`
error[[E0277]](https://doc.rust-lang.org/nightly/error-index.html#E0277): can't compare `fn() {f}` with `fn() {f}`
--> src/main.rs:7:10
|
7 | take(f);
| ---- ^ no implementation for `fn() {f} == fn() {f}`
| |
| required by a bound introduced by this call
|
= help: the trait `PartialEq` is not implemented for fn item `fn() {f}`
= help: the trait `PartialEq` is implemented for fn pointer `fn()`
note: required because of the requirements on the impl of `Trait` for `fn() {f}`
--> src/main.rs:2:20
|
2 | impl<A: PartialEq> Trait for A {}
| ^^^^^ ^
note: required by a bound in `take`
--> src/main.rs:3:17
|
3 | fn take(_: impl Trait) {}
| ^^^^^ required by this bound in `take`
|
help: Convert the fn item to a fn pointer with `as`
|
7 | take(f as fn());
| ++++++++
Given the following code: [playground]
The current output is:
Ideally the output should look like:
A more involved diagnostic example:
[playground]
The current output is:
Ideally the output should look like:
(bonus side effect: hiding the giant list of explicit variadic fn pointer impls)