2015-02-12 14:37:52 +00:00
|
|
|
#![allow(warnings)]
|
2014-05-06 01:56:44 +00:00
|
|
|
|
2015-03-31 23:58:01 +00:00
|
|
|
trait A<T> { }
|
2021-08-25 00:39:40 +00:00
|
|
|
|
2015-08-07 17:23:11 +00:00
|
|
|
struct B<'a, T:'a>(&'a (A<T>+'a));
|
2014-02-26 17:09:15 +00:00
|
|
|
|
2015-03-31 23:58:01 +00:00
|
|
|
trait X { }
|
2014-02-26 17:09:15 +00:00
|
|
|
impl<'a, T> X for B<'a, T> {}
|
|
|
|
|
2015-03-31 23:58:01 +00:00
|
|
|
fn h<'a, T, U:'static>(v: Box<A<U>+'static>) -> Box<X+'static> {
|
2021-08-25 00:39:40 +00:00
|
|
|
Box::new(B(&*v)) as Box<X> //~ ERROR cannot return value referencing local data `*v`
|
2014-02-26 17:09:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|