1 // Test various uses of structs with distint variances to make sure
2 // they permit lifetimes to be approximated as expected.
5 // ignore-compare-mode-nll
6 //[nll] compile-flags: -Z borrowck=mir
8 struct SomeStruct<T>(fn(T));
10 fn foo<'min,'max>(v: SomeStruct<&'max ()>)
11 -> SomeStruct<&'min ()>
15 //[base]~^ ERROR mismatched types
16 //[nll]~^^ ERROR lifetime may not live long enough