]>
Commit | Line | Data |
---|---|---|
85aaf69f SL |
1 | // Test that a covariant struct permits the lifetime of a reference to |
2 | // be shortened. | |
223e47cc | 3 | |
85aaf69f | 4 | #![allow(dead_code)] |
a1dfa0c6 | 5 | // compile-pass |
223e47cc | 6 | |
85aaf69f | 7 | struct SomeStruct<T>(T); |
223e47cc | 8 | |
85aaf69f SL |
9 | fn foo<'min,'max>(v: SomeStruct<&'max ()>) |
10 | -> SomeStruct<&'min ()> | |
11 | where 'max : 'min | |
12 | { | |
13 | v | |
223e47cc | 14 | } |
85aaf69f | 15 | |
a1dfa0c6 | 16 | fn main() { } |