Closed
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.