The following async trait fails to compile. This worked prior to #143.
#![feature(type_alias_impl_trait)]
use async_trait::async_trait;
#[async_trait]
trait Trait {
type Assoc;
async fn f(&self) -> Self::Assoc;
}
struct Struct;
#[async_trait]
impl Trait for Struct {
type Assoc = impl Sized;
async fn f(&self) -> Self::Assoc {}
}
error[E0308]: mismatched types
--> src/main.rs:18:14
|
16 | type Assoc = impl Sized;
| ---------- the expected opaque type
17 |
18 | async fn f(&self) -> Self::Assoc {}
| ^
| |
| expected opaque type, found `()`
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected opaque type `impl Sized`
found unit type `()`
error: could not find defining uses
--> src/main.rs:16:18
|
16 | type Assoc = impl Sized;
| ^^^^^^^^^^
The following async trait fails to compile. This worked prior to #143.