//@ build-pass struct Foo(T); // `T` is covariant. struct Bar { x: T, } // `T` is covariant. fn bar<'b>(x: Bar fn(&'a ())>) { let Bar { x }: Bar = x; } fn bar_nested<'b>(x: Bar fn(&'a ())>>) { let Bar { x: Bar { x } }: Bar> = x; } fn bar_foo_nested<'b>(x: Bar fn(&'a ())>>) { let Bar { x: Foo ( x ) }: Bar> = x; } fn foo<'b>(x: Foo fn(&'a ())>) { let Foo(y): Foo = x; } fn foo_nested<'b>(x: Foo fn(&'a ())>>) { let Foo(Foo(y)): Foo> = x; } fn tuple<'b>(x: (u32, for<'a> fn(&'a ()))) { let (_, y): (u32, fn(&'b ())) = x; } fn tuple_nested<'b>(x: (u32, (u32, for<'a> fn(&'a ())))) { let (_, (_, y)): (u32, (u32, fn(&'b ()))) = x; } fn main() {}