blob: 2f4a0e10427d866d79c25e0d3bacbdd5fe0a3dc0 [file]
error[E0521]: borrowed data escapes outside of function
--> $DIR/any_static.rs:18:35
|
LL | fn extend(a: &Payload) -> &'static Payload {
| - - let's call the lifetime of this reference `'1`
| |
| `a` is only valid in the function body
LL | let b: &(dyn Any + 'static) = try_as_dyn::<&Payload, dyn Any + 'static>(&a).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| `a` escapes the function body here
| argument requires that `'1` must outlive `'static`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0521`.