-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Closed
Copy link
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.F-async_fn_in_traitStatic async fn in traitsStatic async fn in traitsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.F-async_fn_in_traitStatic async fn in traitsStatic async fn in traitsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.