]> git.lizzy.rs Git - rust.git/blob - tests/ui/variance/variance-invariant-self-trait-match.rs
Auto merge of #105924 - TimNN:ui-remap, r=Mark-Simulacrum
[rust.git] / tests / ui / variance / variance-invariant-self-trait-match.rs
1 #![allow(dead_code)]
2
3 trait Get {
4     fn get(&self) -> Self;
5 }
6
7 fn get_min_from_max<'min, 'max, G>()
8     where 'max : 'min, &'max G : Get, G : 'max
9 {
10     impls_get::<&'min G>();
11     //~^ ERROR lifetime may not live long enough
12 }
13
14 fn get_max_from_min<'min, 'max, G>()
15     where 'max : 'min, &'min G : Get, G : 'min
16 {
17     impls_get::<&'max G>();
18     //~^ ERROR lifetime may not live long enough
19 }
20
21 fn impls_get<G>() where G : Get { }
22
23 fn main() { }