]> git.proxmox.com Git - rustc.git/blame - src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.nll.stderr
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / suggestions / impl-on-dyn-trait-with-implicit-static-bound.nll.stderr
CommitLineData
3dfed10e
XL
1error[E0521]: borrowed data escapes outside of function
2 --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:20:9
3 |
4LL | 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 8LL | 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
14error[E0521]: borrowed data escapes outside of function
15 --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69:9
16 |
17LL | 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 21LL | 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
27error[E0521]: borrowed data escapes outside of function
28 --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:88:9
29 |
30LL | 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 34LL | 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
40error[E0521]: borrowed data escapes outside of function
41 --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:108:9
42 |
43LL | 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 47LL | 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
53error: aborting due to 4 previous errors
54
5869c6ff 55For more information about this error, try `rustc --explain E0521`.