1 // build-pass
2
3 // Ensures that we don't regress on "implementation is not general enough" when
4 // normalizating under binders.
5
6 #![feature(no_core)]
7
8 pub trait Yokeable<'a> {
9 type Output: 'a;
10 }
11
12 pub struct Yoke<Y: for<'a> Yokeable<'a>> {
13 _yokeable: Y,
14 }
15
16 impl<Y: for<'a> Yokeable<'a>> Yoke<Y> {
project<'this, P>( &'this self, _f: for<'a> fn(<Y as Yokeable<'a>>::Output, &'a ()) -> <P as Yokeable<'a>>::Output, ) -> Yoke<P> where P: for<'a> Yokeable<'a>,17 pub fn project<'this, P>(
18 &'this self,
19 _f: for<'a> fn(<Y as Yokeable<'a>>::Output, &'a ()) -> <P as Yokeable<'a>>::Output,
20 ) -> Yoke<P>
21 where
22 P: for<'a> Yokeable<'a>,
23 {
24 unimplemented!()
25 }
26 }
27
slice(y: Yoke<&'static ()>) -> Yoke<&'static ()>28 pub fn slice(y: Yoke<&'static ()>) -> Yoke<&'static ()> {
29 y.project(move |yk, _| yk)
30 }
31
32 impl<'a, T> Yokeable<'a> for &'static T {
33 type Output = &'a T;
34 }
35
main()36 fn main() {}
37