Closed
Description
Code
trait Foo {
type T;
async fn foo(&self) -> Self::T;
}
struct Bar;
impl Foo for Bar {
type T = ();
async fn foo(&self) {}
}
impl Foo for Bar {
type T = ();
async fn foo(&self) {}
}
Current output
error[E0284]: type annotations needed: cannot satisfy `<Bar as Foo>::T == ()`
--> src/main.rs:12:5
|
12 | async fn foo(&self) {}
| ^^^^^^^^^^^^^^^^^^^ cannot satisfy `<Bar as Foo>::T == ()`
error[E0284]: type annotations needed: cannot satisfy `<Bar as Foo>::T == ()`
--> src/main.rs:18:5
|
18 | async fn foo(&self) {}
| ^^^^^^^^^^^^^^^^^^^ cannot satisfy `<Bar as Foo>::T == ()`
For more information about this error, try `rustc --explain E0284`.
Desired output
error[E0119]: conflicting implementations of trait `Foo` for type `Bar`
--> src/main.rs:11:1
|
9 | impl Foo for Bar {
| ---------------- first implementation here
...
15 | impl Foo for Bar {
| ^^^^^^^^^^^^^^^^ conflicting implementation for `Bar`
For more information about this error, try `rustc --explain E0119`.
Rationale and extra context
No response
Other cases
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Area: Async & AwaitArea: Messages for errors, warnings, and lintsAsync-await issues that have been triaged during a working group meeting.Diagnostics: Confusing error or lint that should be reworked.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.Static async fn in traitsRelevant to the compiler team, which will review and decide on the PR/issue.