//@ check-pass trait CallWithShim: Sized { type Shim<'s> where Self: 's; } #[derive(Clone)] struct ShimMethod(pub &'static dyn for<'s> Fn(&'s mut T::Shim<'s>)); trait CallWithShim2: Sized { type Shim; } struct S<'s>(&'s ()); #[derive(Clone)] struct ShimMethod2(pub &'static dyn for<'s> Fn(&'s mut T::Shim>)); trait Trait<'s, 't, 'u> {} #[derive(Clone)] struct ShimMethod3( pub &'static dyn for<'s> Fn( &'s mut T::Shim Fn(&'s mut T::Shim Trait<'s, 't, 'u>>)>, ), ); trait Trait2 { type As; } #[derive(Clone)] struct ShimMethod4(pub &'static dyn for<'s> Fn(&'s mut T::As)); pub fn main() {}