summaryrefslogtreecommitdiffstats
path: root/src/test/ui/regions/regions-close-object-into-object-3.rs
blob: 78d93b0ece5b656612590cc769beafbf8694d8f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![allow(warnings)]

trait A<T> { }

struct B<'a, T:'a>(&'a (A<T>+'a));

trait X { }
impl<'a, T> X for B<'a, T> {}

fn h<'a, T, U:'static>(v: Box<A<U>+'static>) -> Box<X+'static> {
    Box::new(B(&*v)) as Box<X> //~ ERROR cannot return value referencing local data `*v`
}

fn main() {}