]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/variance/variance-contravariant-self-trait-match.rs
3 // Test that even when `Self` is only used in contravariant position, it
4 // is treated as invariant.
10 fn get_min_from_max
<'min
, 'max
, G
>()
11 where 'max
: 'min
, G
: 'max
, &'max G
: Get
13 impls_get
::<&'min G
>();
14 //~^ ERROR lifetime may not live long enough
17 fn get_max_from_min
<'min
, 'max
, G
>()
18 where 'max
: 'min
, G
: 'max
, &'min G
: Get
20 // Previously OK, but now error because traits are invariant with
21 // respect to all inputs.
23 impls_get
::<&'max G
>();
24 //~^ ERROR lifetime may not live long enough
27 fn impls_get
<G
>() where G
: Get { }