]>
Commit | Line | Data |
---|---|---|
85aaf69f SL |
1 | // Test various uses of structs with distint variances to make sure |
2 | // they permit lifetimes to be approximated as expected. | |
3 | ||
85aaf69f SL |
4 | struct SomeStruct<T>(*mut T); |
5 | ||
6 | fn foo<'min,'max>(v: SomeStruct<&'max ()>) | |
7 | -> SomeStruct<&'min ()> | |
8 | where 'max : 'min | |
9 | { | |
04454e1e | 10 | v |
923072b8 | 11 | //~^ ERROR lifetime may not live long enough |
85aaf69f SL |
12 | } |
13 | ||
14 | fn bar<'min,'max>(v: SomeStruct<&'min ()>) | |
15 | -> SomeStruct<&'max ()> | |
16 | where 'max : 'min | |
17 | { | |
04454e1e | 18 | v |
923072b8 | 19 | //~^ ERROR lifetime may not live long enough |
85aaf69f SL |
20 | } |
21 | ||
a1dfa0c6 | 22 | |
85aaf69f | 23 | fn main() { } |