]> git.lizzy.rs Git - rust.git/blob - src/test/ui/variance/variance-use-contravariant-struct-1.rs
Auto merge of #84589 - In-line:zircon-thread-name, r=JohnTitor
[rust.git] / src / test / ui / variance / variance-use-contravariant-struct-1.rs
1 // Test various uses of structs with distint variances to make sure
2 // they permit lifetimes to be approximated as expected.
3
4
5
6 struct SomeStruct<T>(fn(T));
7
8 fn foo<'min,'max>(v: SomeStruct<&'max ()>)
9                   -> SomeStruct<&'min ()>
10     where 'max : 'min
11 {
12     v //~ ERROR mismatched types
13 }
14
15
16 fn main() { }