]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/regions-close-object-into-object-1.rs
internally change regions to be covariant
[rust.git] / tests / ui / regions / regions-close-object-into-object-1.rs
1 #![allow(warnings)]
2
3 trait A<T> { }
4
5 struct B<'a, T:'a>(&'a (A<T>+'a));
6
7 trait X { }
8
9 impl<'a, T> X for B<'a, T> {}
10
11 fn f<'a, T:'static, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
12     Box::new(B(&*v)) as Box<X> //~ ERROR cannot return value referencing local data `*v`
13 }
14
15 fn main() {}