summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-close-object-into-object-1.rs
blob: 2dc33d5671ff0597d14d9aa7fce9ff2a87a63ae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![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 f<'a, T:'static, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
    Box::new(B(&*v)) as Box<X> //~ ERROR cannot return value referencing local data `*v`
}

fn main() {}