| error[E0521]: borrowed data escapes outside of function |
| --> $DIR/static_method_bound.rs:30:37 |
| | |
| LL | fn extend(a: &Payload) -> &'static Payload { |
| | - - let's call the lifetime of this reference `'1` |
| | | |
| | `a` is a reference that is only valid in the function body |
| LL | let b: &(dyn Trait + 'static) = try_as_dyn::<&Payload, dyn Trait + '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`. |