2021-09-28 22:46:29 +00:00
|
|
|
// check-pass
|
|
|
|
|
|
|
|
trait CallWithShim: Sized {
|
|
|
|
type Shim<'s>
|
|
|
|
where
|
|
|
|
Self: 's;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
struct ShimMethod<T: CallWithShim + 'static>(pub &'static dyn for<'s> Fn(&'s mut T::Shim<'s>));
|
|
|
|
|
2021-09-29 18:17:33 +00:00
|
|
|
trait CallWithShim2: Sized {
|
|
|
|
type Shim<T>;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct S<'s>(&'s ());
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
struct ShimMethod2<T: CallWithShim2 + 'static>(pub &'static dyn for<'s> Fn(&'s mut T::Shim<S<'s>>));
|
|
|
|
|
2021-10-02 09:26:10 +00:00
|
|
|
trait Trait<'s, 't, 'u> {}
|
2021-09-29 18:17:33 +00:00
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
struct ShimMethod3<T: CallWithShim2 + 'static>(
|
2021-10-02 09:26:10 +00:00
|
|
|
pub &'static dyn for<'s> Fn(
|
|
|
|
&'s mut T::Shim<dyn for<'t> Fn(&'s mut T::Shim<dyn for<'u> Trait<'s, 't, 'u>>)>,
|
|
|
|
),
|
2021-09-29 18:17:33 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
trait Trait2 {
|
|
|
|
type As;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
struct ShimMethod4<T: Trait2 + 'static>(pub &'static dyn for<'s> Fn(&'s mut T::As));
|
|
|
|
|
2021-09-28 22:46:29 +00:00
|
|
|
pub fn main() {}
|