3 // Test that even when `T` is only used in covariant position, it
4 // is treated as invariant.
7 // ignore-compare-mode-nll
8 //[nll] compile-flags: -Z borrowck=mir
14 fn get_min_from_max<'min, 'max, G>()
15 where 'max : 'min, G : Get<&'max i32>
17 // Previously OK, now an error as traits are invariant.
18 impls_get::<G,&'min i32>()
19 //[base]~^ ERROR mismatched types
20 //[nll]~^^ ERROR lifetime may not live long enough
23 fn get_max_from_min<'min, 'max, G>()
24 where 'max : 'min, G : Get<&'min i32>
26 impls_get::<G,&'max i32>()
27 //[base]~^ ERROR mismatched types
28 //[nll]~^^ ERROR lifetime may not live long enough
31 fn impls_get<G,T>() where G : Get<T> { }