2015-02-12 05:16:02 -05:00
|
|
|
// Test that a covariant struct does not permit the lifetime of a
|
|
|
|
// reference to be enlarged.
|
|
|
|
|
|
|
|
struct SomeStruct<T>(T);
|
|
|
|
|
|
|
|
fn foo<'min,'max>(v: SomeStruct<&'min ()>)
|
|
|
|
-> SomeStruct<&'max ()>
|
|
|
|
where 'max : 'min
|
|
|
|
{
|
2022-04-01 22:12:17 -04:00
|
|
|
v
|
2022-04-01 13:13:25 -04:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
2015-02-12 05:16:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|