]> git.proxmox.com Git - rustc.git/blame - src/test/ui/variance/variance-use-covariant-struct-2.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / variance / variance-use-covariant-struct-2.rs
CommitLineData
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)]
416331ca 5// build-pass (FIXME(62277): could be check-pass?)
223e47cc 6
85aaf69f 7struct SomeStruct<T>(T);
223e47cc 8
85aaf69f
SL
9fn foo<'min,'max>(v: SomeStruct<&'max ()>)
10 -> SomeStruct<&'min ()>
11 where 'max : 'min
12{
13 v
223e47cc 14}
85aaf69f 15
a1dfa0c6 16fn main() { }