Closed wfraser closed 3 years ago
Looks like the expanded code is: (cleaned up a little)
trait MyTrait {
#[must_use]
fn blah<'life0, 'async_trait>(&'life0 self, values: impl Iterator<Item = i32> + Send + 'async_trait)
-> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: Sync + 'async_trait
{
async fn __blah<'async_trait, AsyncTrait: ?Sized + MyTrait + Sync>(
_self: &AsyncTrait,
values: impl Iterator<Item = i32> + Send + 'async_trait,
) {
println!( ... );
}
Box::pin(__blah::<Self>(self, values))
}
}
and rustc does not like the explicit generic argument in __blah::<Self>(self, values)
. Simply removing that ::<Self>
turbofish works for this case at least.
Same issue.
Given the code:
this fails to compile with the error:
If I remove the default body, it works.
Is this intended to be supported? I can work around it by boxing and using
dyn
, i.e.values: Box<dyn Iterator<Item=i32> + Send + 'async_trait>
but that's not ideal.Thanks for this crate!