]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/regions-close-object-into-object-3.rs
add UI test + docs for `E0789`
[rust.git] / tests / ui / regions / regions-close-object-into-object-3.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 impl<'a, T> X for B<'a, T> {}
9
10 fn h<'a, T, U:'static>(v: Box<A<U>+'static>) -> Box<X+'static> {
11     Box::new(B(&*v)) as Box<X> //~ ERROR cannot return value referencing local data `*v`
12 }
13
14 fn main() {}