Open
Description
Update: See #60658 (comment) for the latest reproducer
Minimal:
#![feature(async_await, await_macro)]
use std::future::Future;
pub trait Foo<'a> {
type Future: Future<Output = ()>;
fn foo() -> Self::Future;
}
struct MyType<T>;
impl<'a, T> Foo<'a> for MyType<T>
where
T: Foo<'a>,
T::Future: Send,
{
type Future = Box<Future<Output = ()> + Send>;
fn foo() -> Self::Future {
Box::new(async move {
await!(T::foo())
})
}
}
fn main() {
}
Out:
Compiling playground v0.0.1 (/playground)
error[E0308]: mismatched types
--> src/main.rs:21:9
|
21 | / Box::new(async move {
22 | | await!(T::foo())
23 | | })
| |__________^ one type is more general than the other
|
= note: expected type `std::marker::Send`
found type `std::marker::Send`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
Compiler version: rustc 1.36.0-nightly (2019-05-07)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
On deck