]>
Commit | Line | Data |
---|---|---|
3dfed10e | 1 | error[E0759]: `value` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement |
f9f354fc | 2 | --> $DIR/issue-16922.rs:4:14 |
8faf50e0 | 3 | | |
dc9dc135 | 4 | LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> { |
f035d41b | 5 | | -- this data with an anonymous lifetime `'_`... |
dc9dc135 | 6 | LL | Box::new(value) as Box<dyn Any> |
a2a8927a | 7 | | ^^^^^ ...is used and required to live as long as `'static` here |
f9f354fc | 8 | | |
f035d41b | 9 | help: to declare that the trait object captures data from argument `value`, you can add an explicit `'_` lifetime bound |
f9f354fc XL |
10 | | |
11 | LL | fn foo<T: Any>(value: &T) -> Box<dyn Any + '_> { | |
94222f64 | 12 | | ++++ |
8faf50e0 XL |
13 | |
14 | error: aborting due to previous error | |
15 | ||
f035d41b | 16 | For more information about this error, try `rustc --explain E0759`. |