]>
Commit | Line | Data |
---|---|---|
487cf647 | 1 | // check-pass |
2b03887a | 2 | // edition: 2021 |
353b0b11 FG |
3 | // [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty |
4 | // revisions: current next | |
2b03887a FG |
5 | |
6 | #![feature(async_fn_in_trait)] | |
487cf647 | 7 | #![feature(impl_trait_projections)] |
2b03887a FG |
8 | #![allow(incomplete_features)] |
9 | ||
10 | use std::fmt::Debug; | |
11 | ||
12 | trait MyTrait<'a, 'b, T> where Self: 'a, T: Debug + Sized + 'b { | |
13 | type MyAssoc; | |
14 | ||
15 | async fn foo(&'a self, key: &'b T) -> Self::MyAssoc; | |
16 | } | |
17 | ||
18 | impl<'a, 'b, T: Debug + Sized + 'b, U: 'a> MyTrait<'a, 'b, T> for U { | |
19 | type MyAssoc = (&'a U, &'b T); | |
20 | ||
21 | async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) { | |
22 | (self, key) | |
23 | } | |
24 | } | |
25 | ||
26 | fn main() {} |