]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hrtb/issue-88446.rs
Auto merge of #98120 - TaKO8Ki:box-diagnostic-metadata-field, r=estebank
[rust.git] / src / test / ui / hrtb / issue-88446.rs
1 // check-pass
2
3 trait Yokeable<'a> {
4     type Output: 'a;
5 }
6 impl<'a> Yokeable<'a> for () {
7     type Output = ();
8 }
9
10 trait DataMarker<'data> {
11     type Yokeable: for<'a> Yokeable<'a>;
12 }
13 impl<'data> DataMarker<'data> for () {
14     type Yokeable = ();
15 }
16
17 struct DataPayload<'data, M>(&'data M);
18
19 impl DataPayload<'static, ()> {
20     pub fn map_project_with_capture<M2, T>(
21         _: for<'a> fn(
22             capture: T,
23             std::marker::PhantomData<&'a ()>,
24         ) -> <M2::Yokeable as Yokeable<'a>>::Output,
25     ) -> DataPayload<'static, M2>
26     where
27         M2: DataMarker<'static>,
28     {
29         todo!()
30     }
31 }
32
33 fn main() {
34     let _: DataPayload<()> = DataPayload::<()>::map_project_with_capture::<_, &()>(|_, _| todo!());
35 }