1 error[E0521]: borrowed data escapes outside of function
2 --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:20:9
4 LL | fn use_it<'a, T>(val: &'a dyn ObjectTrait<T>) -> impl OtherTrait<'a> + 'a {
5 | --- `val` is a reference that is only valid in the function body
6 LL | val.use_self::<T>()
7 | ^^^^^^^^^^^^^^^^^^^ `val` escapes the function body here
9 = help: consider replacing `'a` with `'static`
11 error[E0521]: borrowed data escapes outside of function
12 --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69:9
14 LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
15 | --- `val` is a reference that is only valid in the function body
17 | ^^^^^^^^^^^^^^ `val` escapes the function body here
19 = help: consider replacing `'a` with `'static`
21 error[E0521]: borrowed data escapes outside of function
22 --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:88:9
24 LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> {
25 | --- `val` is a reference that is only valid in the function body
27 | ^^^^^^^^^^^^^^ `val` escapes the function body here
29 = help: consider replacing `'a` with `'static`
31 error[E0521]: borrowed data escapes outside of function
32 --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:108:9
34 LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
35 | --- `val` is a reference that is only valid in the function body
36 LL | MyTrait::use_self(val)
37 | ^^^^^^^^^^^^^^^^^^^^^^ `val` escapes the function body here
39 = help: consider replacing `'a` with `'static`
41 error: aborting due to 4 previous errors
43 For more information about this error, try `rustc --explain E0521`.