]> git.proxmox.com Git - rustc.git/blob - src/test/ui/regions/regions-close-object-into-object-4.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / regions / regions-close-object-into-object-4.stderr
1 error[E0759]: `v` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
2 --> $DIR/regions-close-object-into-object-4.rs:10:11
3 |
4 LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
5 | ---------------- this data with lifetime `'a`...
6 LL | box B(&*v) as Box<dyn X>
7 | ^^^ ...is captured here, requiring it to live as long as `'static`
8 |
9 help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
10 |
11 LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'a> {
12 | ~~
13 help: alternatively, add an explicit `'static` bound to this reference
14 |
15 LL | fn i<'a, T, U>(v: Box<(dyn A<U> + 'static)>) -> Box<dyn X + 'static> {
16 | ~~~~~~~~~~~~~~~~~~~~~~~~~
17
18 error: aborting due to previous error
19
20 For more information about this error, try `rustc --explain E0759`.