]>
Commit | Line | Data |
---|---|---|
3dfed10e XL |
1 | error[E0521]: borrowed data escapes outside of function |
2 | --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:20:9 | |
3 | | | |
4 | LL | fn use_it<'a, T>(val: &'a dyn ObjectTrait<T>) -> impl OtherTrait<'a> + 'a { | |
c295e0f8 XL |
5 | | -- --- `val` is a reference that is only valid in the function body |
6 | | | | |
7 | | lifetime `'a` defined here | |
3dfed10e | 8 | LL | val.use_self::<T>() |
c295e0f8 XL |
9 | | ^^^^^^^^^^^^^^^^^^^ |
10 | | | | |
11 | | `val` escapes the function body here | |
12 | | argument requires that `'a` must outlive `'static` | |
3dfed10e XL |
13 | |
14 | error[E0521]: borrowed data escapes outside of function | |
15 | --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69:9 | |
16 | | | |
17 | LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { | |
c295e0f8 XL |
18 | | -- --- `val` is a reference that is only valid in the function body |
19 | | | | |
20 | | lifetime `'a` defined here | |
3dfed10e | 21 | LL | val.use_self() |
c295e0f8 XL |
22 | | ^^^^^^^^^^^^^^ |
23 | | | | |
24 | | `val` escapes the function body here | |
25 | | argument requires that `'a` must outlive `'static` | |
3dfed10e XL |
26 | |
27 | error[E0521]: borrowed data escapes outside of function | |
28 | --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:88:9 | |
29 | | | |
30 | LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> { | |
c295e0f8 XL |
31 | | -- --- `val` is a reference that is only valid in the function body |
32 | | | | |
33 | | lifetime `'a` defined here | |
3dfed10e | 34 | LL | val.use_self() |
c295e0f8 XL |
35 | | ^^^^^^^^^^^^^^ |
36 | | | | |
37 | | `val` escapes the function body here | |
38 | | argument requires that `'a` must outlive `'static` | |
3dfed10e XL |
39 | |
40 | error[E0521]: borrowed data escapes outside of function | |
41 | --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:108:9 | |
42 | | | |
43 | LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a { | |
c295e0f8 XL |
44 | | -- --- `val` is a reference that is only valid in the function body |
45 | | | | |
46 | | lifetime `'a` defined here | |
3dfed10e | 47 | LL | MyTrait::use_self(val) |
c295e0f8 XL |
48 | | ^^^^^^^^^^^^^^^^^^^^^^ |
49 | | | | |
50 | | `val` escapes the function body here | |
51 | | argument requires that `'a` must outlive `'static` | |
3dfed10e XL |
52 | |
53 | error: aborting due to 4 previous errors | |
54 | ||
5869c6ff | 55 | For more information about this error, try `rustc --explain E0521`. |