]> git.lizzy.rs Git - rust.git/blob - src/test/ui/variance/variance-invariant-self-trait-match.rs
Merge commit '0969bc6dde001e01e7e1f58c8ccd7750f8a49ae1' into sync_cg_clif-2021-03-29
[rust.git] / src / test / 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>(); //~ ERROR mismatched types
11 }
12
13 fn get_max_from_min<'min, 'max, G>()
14     where 'max : 'min, &'min G : Get, G : 'min
15 {
16     impls_get::<&'max G>(); //~ ERROR mismatched types
17 }
18
19 fn impls_get<G>() where G : Get { }
20
21 fn main() { }