]> git.lizzy.rs Git - rust.git/blob - src/test/ui/variance/variance-use-covariant-struct-1.rs
Merge commit 'e214ea82ad0a751563acf67e1cd9279cf302db3a' into clippyup
[rust.git] / src / test / ui / variance / variance-use-covariant-struct-1.rs
1 // Test that a covariant struct does not permit the lifetime of a
2 // reference to be enlarged.
3
4 struct SomeStruct<T>(T);
5
6 fn foo<'min,'max>(v: SomeStruct<&'min ()>)
7                   -> SomeStruct<&'max ()>
8     where 'max : 'min
9 {
10     v //~ ERROR mismatched types
11 }
12
13 fn main() { }