1 // Test that an invariant region parameter used in a contravariant way
4 // Note: see variance-regions-*.rs for the tests that check that the
5 // variance inference works in the first place.
11 fn use_<'short,'long>(c: Invariant<'long>,
14 _where:Option<&'short &'long ()>) {
16 // Test whether Invariant<'long> <: Invariant<'short>. Since
17 // 'short <= 'long, this would be true if the Invariant type were
18 // contravariant with respect to its parameter 'a.
20 let _: Invariant<'short> = c;
21 //~^ ERROR lifetime may not live long enough