2022-08-17 21:13:37 -05:00
|
|
|
// Test various uses of structs with distinct variances to make sure
|
2015-02-12 04:16:02 -06:00
|
|
|
// they permit lifetimes to be approximated as expected.
|
|
|
|
|
|
|
|
struct SomeStruct<T>(fn(T));
|
|
|
|
|
|
|
|
fn foo<'min,'max>(v: SomeStruct<&'max ()>)
|
|
|
|
-> SomeStruct<&'min ()>
|
|
|
|
where 'max : 'min
|
|
|
|
{
|
2022-04-01 21:12:17 -05:00
|
|
|
v
|
2022-04-01 12:13:25 -05:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
2015-02-12 04:16:02 -06:00
|
|
|
}
|
|
|
|
|
2018-10-30 18:18:11 -05:00
|
|
|
|
2015-02-12 04:16:02 -06:00
|
|
|
fn main() { }
|