]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-16922.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / issues / issue-16922.stderr
1 error[E0759]: `value` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
2 --> $DIR/issue-16922.rs:4:14
3 |
4 LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> {
5 | -- this data with an anonymous lifetime `'_`...
6 LL | Box::new(value) as Box<dyn Any>
7 | ^^^^^ ...is captured here, requiring it to live as long as `'static`
8 |
9 help: to declare that the trait object captures data from argument `value`, you can add an explicit `'_` lifetime bound
10 |
11 LL | fn foo<T: Any>(value: &T) -> Box<dyn Any + '_> {
12 | ++++
13
14 error: aborting due to previous error
15
16 For more information about this error, try `rustc --explain E0759`.