Closed
Description
Given the following code: playground
trait Foo {
fn bar() {}
}
fn main() {
Foo::bar();
}
The current output is:
error[E0283]: type annotations needed
--> src/main.rs:4:5
|
4 | Foo::bar();
| ^^^^^^^^ cannot infer type
|
= note: cannot satisfy `_: Foo`
Ideally the output should look like:
Cannot call trait method as a free function. It needs an actual type to be implemented on for it to be called.
For bonus points: The trait is currently not callable since it's not implemented for anything. It needs to actually be implemented. "It looks like you're trying to call this trait method, but nothing implements it."