rust/tests/ui/regions/regions-close-object-into-object-3.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
286 B
Rust
Raw Normal View History

#![allow(warnings)]
2015-03-31 18:58:01 -05:00
trait A<T> { }
struct B<'a, T:'a>(&'a (A<T>+'a));
2015-03-31 18:58:01 -05:00
trait X { }
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> {
Box::new(B(&*v)) as Box<X> //~ ERROR cannot return value referencing local data `*v`
}
fn main() {}