mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
15 lines
286 B
Rust
15 lines
286 B
Rust
#![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() {}
|