]> git.proxmox.com Git - rustc.git/blame - src/test/ui/variance/variance-use-invariant-struct-1.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / variance / variance-use-invariant-struct-1.rs
CommitLineData
f2b60f7d 1// Test various uses of structs with distinct variances to make sure
85aaf69f
SL
2// they permit lifetimes to be approximated as expected.
3
85aaf69f
SL
4struct SomeStruct<T>(*mut T);
5
6fn 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
14fn 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 23fn main() { }