]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/variance/variance-contravariant-arg-object.rs
3 // Test that even when `T` is only used in contravariant position, it
4 // is treated as invariant.
6 trait Get
<T
> : '
static {
10 fn get_min_from_max
<'min
, 'max
>(v
: Box
<dyn Get
<&'max
i32>>)
11 -> Box
<dyn Get
<&'min
i32>>
15 //~^ ERROR lifetime may not live long enough
18 fn get_max_from_min
<'min
, 'max
>(v
: Box
<dyn Get
<&'min
i32>>)
19 -> Box
<dyn Get
<&'max
i32>>
24 //~^ ERROR lifetime may not live long enough