@@ -10,6 +10,18 @@ LL | val.use_self::<T>()
10
10
| |
11
11
| `val` escapes the function body here
12
12
| argument requires that `'a` must outlive `'static`
13
+ |
14
+ note: the used `impl` has a `'static` requirement
15
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:19:32
16
+ |
17
+ LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> {
18
+ | ^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
19
+ LL | fn use_self<K>(&self) -> &() { panic!() }
20
+ | -------- calling this method introduces the `impl`'s 'static` requirement
21
+ help: consider relaxing the implicit `'static` requirement
22
+ |
23
+ LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> + '_ {
24
+ | ++++
13
25
14
26
error[E0521]: borrowed data escapes outside of function
15
27
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:74:9
@@ -23,6 +35,18 @@ LL | val.use_self()
23
35
| |
24
36
| `val` escapes the function body here
25
37
| argument requires that `'a` must outlive `'static`
38
+ |
39
+ note: the used `impl` has a `'static` requirement
40
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:69:14
41
+ |
42
+ LL | impl dyn ObjectTrait {
43
+ | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
44
+ LL | fn use_self(&self) -> &() { panic!() }
45
+ | -------- calling this method introduces the `impl`'s 'static` requirement
46
+ help: consider relaxing the implicit `'static` requirement
47
+ |
48
+ LL | impl dyn ObjectTrait + '_ {
49
+ | ++++
26
50
27
51
error[E0521]: borrowed data escapes outside of function
28
52
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:94:9
@@ -36,6 +60,19 @@ LL | val.use_self()
36
60
| |
37
61
| `val` escapes the function body here
38
62
| argument requires that `'a` must outlive `'static`
63
+ |
64
+ note: the used `impl` has a `'static` requirement
65
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:91:26
66
+ |
67
+ LL | fn use_self(&self) -> &() { panic!() }
68
+ | -------- calling this method introduces the `impl`'s 'static` requirement
69
+ ...
70
+ LL | impl MyTrait for dyn ObjectTrait {}
71
+ | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
72
+ help: consider relaxing the implicit `'static` requirement
73
+ |
74
+ LL | impl MyTrait for dyn ObjectTrait + '_ {}
75
+ | ++++
39
76
40
77
error[E0521]: borrowed data escapes outside of function
41
78
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:114:9
@@ -49,6 +86,19 @@ LL | MyTrait::use_self(val)
49
86
| |
50
87
| `val` escapes the function body here
51
88
| argument requires that `'a` must outlive `'static`
89
+ |
90
+ note: the used `impl` has a `'static` requirement
91
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-nll.rs:110:26
92
+ |
93
+ LL | fn use_self(&self) -> &() { panic!() }
94
+ | -------- calling this method introduces the `impl`'s 'static` requirement
95
+ ...
96
+ LL | impl MyTrait for dyn ObjectTrait {}
97
+ | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
98
+ help: consider relaxing the implicit `'static` requirement
99
+ |
100
+ LL | impl MyTrait for dyn ObjectTrait + '_ {}
101
+ | ++++
52
102
53
103
error: aborting due to 4 previous errors
54
104
0 commit comments