]> git.lizzy.rs Git - rust.git/blob - src/test/ui/variance/variance-invariant-arg-trait-match.rs
Rollup merge of #93389 - cameron1024:issue-90847-regression, r=Mark-Simulacrum
[rust.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>() //~ ERROR mismatched types
11 }
12
13 fn get_max_from_min<'min, 'max, G>()
14     where 'max : 'min, G : Get<&'min i32>
15 {
16     impls_get::<G,&'max i32>() //~ ERROR mismatched types
17 }
18
19 fn impls_get<G,T>() where G : Get<T> { }
20
21 fn main() { }