]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.nll.stderr
Rollup merge of #87596 - jesyspa:issue-87318-hidden-whitespace, r=estebank
[rust.git] / src / test / ui / suggestions / impl-on-dyn-trait-with-implicit-static-bound.nll.stderr
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 {
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
8    |
9    = help: consider replacing `'a` with `'static`
10
11 error[E0521]: borrowed data escapes outside of function
12   --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69:9
13    |
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
16 LL |         val.use_self()
17    |         ^^^^^^^^^^^^^^ `val` escapes the function body here
18    |
19    = help: consider replacing `'a` with `'static`
20
21 error[E0521]: borrowed data escapes outside of function
22   --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:88:9
23    |
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
26 LL |         val.use_self()
27    |         ^^^^^^^^^^^^^^ `val` escapes the function body here
28    |
29    = help: consider replacing `'a` with `'static`
30
31 error[E0521]: borrowed data escapes outside of function
32   --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:108:9
33    |
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
38    |
39    = help: consider replacing `'a` with `'static`
40
41 error: aborting due to 4 previous errors
42
43 For more information about this error, try `rustc --explain E0521`.