diff options
| author | b-naber <bn263@gmx.de> | 2022-11-02 13:49:42 +0100 |
|---|---|---|
| committer | b-naber <bn263@gmx.de> | 2022-11-23 19:59:00 +0100 |
| commit | 906c52743aa60002abadae2a9f19673bdad3cf80 (patch) | |
| tree | 45d347d1582eb463e130f3f5f6b9d08ab64bae8a | |
| parent | 4d3a91b12b8c9e1b89a19c3663f430e58c16acd3 (diff) | |
| download | rust-906c52743aa60002abadae2a9f19673bdad3cf80.tar.gz rust-906c52743aa60002abadae2a9f19673bdad3cf80.zip | |
add tests
| -rw-r--r-- | src/test/ui/mir/field-ty-ascription.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/mir/field-ty-ascription.rs b/src/test/ui/mir/field-ty-ascription.rs new file mode 100644 index 00000000000..4147f05776a --- /dev/null +++ b/src/test/ui/mir/field-ty-ascription.rs @@ -0,0 +1,21 @@ +// build-pass + +struct Foo<T>(T); // `T` is covariant. + +fn foo<'b>(x: Foo<for<'a> fn(&'a ())>) { + let Foo(y): Foo<fn(&'b ())> = x; +} + +fn foo_nested<'b>(x: Foo<Foo<for<'a> fn(&'a ())>>) { + let Foo(Foo(y)): Foo<Foo<fn(&'b ())>> = 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() {} |
