-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.AsyncAwait-PolishAsync-await issues that are part of the "polish" areaAsync-await issues that are part of the "polish" areaC-bugCategory: This is a bug.Category: This is a bug.T-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
With the following code:
trait Trait {
type Assoc;
}
async fn foo<T: Trait<Assoc = ()>>() -> T::Assoc {
()
}
comes the following error:
error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == <T as Trait>::Assoc`
--> src/lib.rs:7:41
|
7 | async fn foo<T: Trait<Assoc = ()>>() -> T::Assoc {
| ^^^^^^^^ expected (), found associated type
|
= note: expected type `()`
found type `<T as Trait>::Assoc`
= note: the return type of a function must have a statically known size
error: aborting due to previous error
However, this function compiles correctly without the async
keyword.
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.AsyncAwait-PolishAsync-await issues that are part of the "polish" areaAsync-await issues that are part of the "polish" areaC-bugCategory: This is a bug.Category: This is a bug.T-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.