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