Skip to content

Commit 906c527

Browse files
committed
add tests
1 parent 4d3a91b commit 906c527

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// build-pass
2+
3+
struct Foo<T>(T); // `T` is covariant.
4+
5+
fn foo<'b>(x: Foo<for<'a> fn(&'a ())>) {
6+
let Foo(y): Foo<fn(&'b ())> = x;
7+
}
8+
9+
fn foo_nested<'b>(x: Foo<Foo<for<'a> fn(&'a ())>>) {
10+
let Foo(Foo(y)): Foo<Foo<fn(&'b ())>> = x;
11+
}
12+
13+
fn tuple<'b>(x: (u32, for<'a> fn(&'a ()))) {
14+
let (_, y): (u32, fn(&'b ())) = x;
15+
}
16+
17+
fn tuple_nested<'b>(x: (u32, (u32, for<'a> fn(&'a ())))) {
18+
let (_, (_, y)): (u32, (u32, fn(&'b ()))) = x;
19+
}
20+
21+
fn main() {}

0 commit comments

Comments
 (0)