]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/regions/regions-variance-invariant-use-covariant.rs
1 // Test that a type which is invariant with respect to its region
2 // parameter used in a covariant way yields an error.
4 // Note: see variance-regions-*.rs for the tests that check that the
5 // variance inference works in the first place.
11 fn use_
<'b
>(c
: Invariant
<'b
>) {
13 // For this assignment to be legal, Invariant<'b> <: Invariant<'static>.
14 // Since 'b <= 'static, this would be true if Invariant were covariant
15 // with respect to its parameter 'a.
17 let _
: Invariant
<'
static> = c
;
18 //~^ ERROR lifetime may not live long enough