]> git.proxmox.com Git - rustc.git/blob - src/test/ui/variance/variance-invariant-arg-trait-match.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / variance / variance-invariant-arg-trait-match.rs
1 #![allow(dead_code)]
2
3 trait Get<T> {
4 fn get(&self, t: T) -> T;
5 }
6
7 fn get_min_from_max<'min, 'max, G>()
8 where 'max : 'min, G : Get<&'max i32>
9 {
10 impls_get::<G,&'min i32>()
11 //~^ ERROR lifetime may not live long enough
12 }
13
14 fn get_max_from_min<'min, 'max, G>()
15 where 'max : 'min, G : Get<&'min i32>
16 {
17 impls_get::<G,&'max i32>()
18 //~^ ERROR lifetime may not live long enough
19 }
20
21 fn impls_get<G,T>() where G : Get<T> { }
22
23 fn main() { }