]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-close-object-into-object-5.rs
Auto merge of #56079 - mark-i-m:patch-1, r=nikomatsakis
[rust.git] / src / test / ui / regions / regions-close-object-into-object-5.rs
1 #![feature(box_syntax)]
2 #![allow(warnings)]
3
4 trait A<T>
5 {
6     fn get(&self) -> T { panic!() }
7 }
8
9 struct B<'a, T:'a>(&'a (A<T>+'a));
10
11 trait X { fn foo(&self) {} }
12
13 impl<'a, T> X for B<'a, T> {}
14
15 fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> {
16     // oh dear!
17     box B(&*v) as Box<X>
18         //~^ ERROR the parameter type `T` may not live long enough
19         //~| ERROR the parameter type `T` may not live long enough
20         //~| ERROR the parameter type `T` may not live long enough
21         //~| ERROR the parameter type `T` may not live long enough
22         //~| ERROR the parameter type `T` may not live long enough
23         //~| ERROR the parameter type `T` may not live long enough
24 }
25
26 fn main() {}