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