]> git.lizzy.rs Git - rust.git/blob - src/test/ui/variance/variance-invariant-arg-object.rs
Rollup merge of #89726 - jkugelman:must-use-alloc-constructors, r=joshtriplett
[rust.git] / src / test / ui / variance / variance-invariant-arg-object.rs
1 #![allow(dead_code)]
2
3 trait Get<T> : 'static {
4     fn get(&self, t: T) -> T;
5 }
6
7 fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
8                                 -> Box<dyn Get<&'min i32>>
9     where 'max : 'min
10 {
11     v //~ ERROR mismatched types
12 }
13
14 fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
15                                    -> Box<dyn Get<&'max i32>>
16     where 'max : 'min
17 {
18     v //~ ERROR mismatched types
19 }
20
21 fn main() { }