]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/in-trait/async-associated-types.rs
Rollup merge of #105482 - wesleywiser:fix_debuginfo_ub, r=tmiasko
[rust.git] / src / test / ui / async-await / in-trait / async-associated-types.rs
1 // check-pass
2 // edition: 2021
3
4 #![feature(async_fn_in_trait)]
5 #![feature(impl_trait_projections)]
6 #![allow(incomplete_features)]
7
8 use std::fmt::Debug;
9
10 trait MyTrait<'a, 'b, T> where Self: 'a, T: Debug + Sized + 'b {
11     type MyAssoc;
12
13     async fn foo(&'a self, key: &'b T) -> Self::MyAssoc;
14 }
15
16 impl<'a, 'b, T: Debug + Sized + 'b, U: 'a> MyTrait<'a, 'b, T> for U {
17     type MyAssoc = (&'a U, &'b T);
18
19     async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
20         (self, key)
21     }
22 }
23
24 fn main() {}