summaryrefslogtreecommitdiffstats
path: root/tests/ui/mir/field-ty-ascription-enums.rs
blob: 179af617090635ade42d828a10a9082d732ee1e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// build-pass

enum Foo<T> {
    Var(T),
} // `T` is covariant.

fn foo<'b>(x: Foo<for<'a> fn(&'a ())>) {
    let Foo::Var(x): Foo<fn(&'b ())> = x;
}

fn foo_nested<'b>(x: Foo<Foo<for<'a> fn(&'a ())>>) {
    let Foo::Var(Foo::Var(x)): Foo<Foo<fn(&'b ())>> = x;
}

fn main() {}