blob: 3aebdd8224da60d61922183b680756fffa0393fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// Repro for <https://github.com/rust-lang/rust/issues/60658#issuecomment-1509321859>.
//@ edition: 2021
//@ revisions: assumptions no_assumptions
//@[assumptions] compile-flags: -Zhigher-ranked-assumptions
//@[assumptions] known-bug: unknown
//@[no_assumptions] known-bug: #110338
use core::pin::Pin;
use std::future::Future;
pub trait Foo<'a> {
type Future: Future<Output = ()>;
fn foo() -> Self::Future;
}
struct MyType<T>(T);
impl<'a, T> Foo<'a> for MyType<T>
where
T: Foo<'a>,
T::Future: Send,
{
type Future = Pin<Box<dyn Future<Output = ()> + Send + 'a>>;
fn foo() -> Self::Future {
Box::pin(async move { <T as Foo<'a>>::foo().await })
}
}
fn main() {}
|