mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-13 09:05:00 +00:00
16 lines
278 B
Rust
16 lines
278 B
Rust
//@ 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() {}
|