1
1
error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
2
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:20 :13
2
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:25 :13
3
3
|
4
4
LL | fn use_it<'a, T>(val: &'a dyn ObjectTrait<T>) -> impl OtherTrait<'a> + 'a {
5
5
| ---------------------- this data with lifetime `'a`...
6
6
LL | val.use_self::<T>()
7
7
| ^^^^^^^^ ...is used and required to live as long as `'static` here
8
8
|
9
9
note: the used `impl` has a `'static` requirement
10
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:14 :32
10
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:19 :32
11
11
|
12
12
LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> {
13
13
| ^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
@@ -19,15 +19,15 @@ LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> + '_ {
19
19
| ++++
20
20
21
21
error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
22
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69 :13
22
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:74 :13
23
23
|
24
24
LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
25
25
| ------------------- this data with lifetime `'a`...
26
26
LL | val.use_self()
27
27
| ^^^^^^^^ ...is used and required to live as long as `'static` here because of an implicit lifetime bound on the inherent `impl`
28
28
|
29
29
note: the used `impl` has a `'static` requirement
30
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:64 :14
30
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69 :14
31
31
|
32
32
LL | impl dyn ObjectTrait {
33
33
| ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
@@ -39,15 +39,15 @@ LL | impl dyn ObjectTrait + '_ {
39
39
| ++++
40
40
41
41
error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
42
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:88 :13
42
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:93 :13
43
43
|
44
44
LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> {
45
45
| ------------------- this data with lifetime `'a`...
46
46
LL | val.use_self()
47
47
| ^^^^^^^^ ...is used and required to live as long as `'static` here
48
48
|
49
49
note: the used `impl` has a `'static` requirement
50
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:85 :26
50
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:90 :26
51
51
|
52
52
LL | fn use_self(&self) -> &() { panic!() }
53
53
| -------- calling this method introduces the `impl`'s 'static` requirement
@@ -64,20 +64,20 @@ LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
64
64
| ++++
65
65
66
66
error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
67
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:108 :27
67
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:113 :27
68
68
|
69
69
LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
70
70
| ------------------- this data with lifetime `'a`...
71
71
LL | MyTrait::use_self(val)
72
72
| ^^^ ...is used here...
73
73
|
74
74
note: ...and is required to live as long as `'static` here
75
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:108 :9
75
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:113 :9
76
76
|
77
77
LL | MyTrait::use_self(val)
78
78
| ^^^^^^^^^^^^^^^^^
79
79
note: the used `impl` has a `'static` requirement
80
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:104 :26
80
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:109 :26
81
81
|
82
82
LL | fn use_self(&self) -> &() { panic!() }
83
83
| -------- calling this method introduces the `impl`'s 'static` requirement
@@ -90,15 +90,15 @@ LL | impl MyTrait for dyn ObjectTrait + '_ {}
90
90
| ++++
91
91
92
92
error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
93
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:37 :13
93
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:42 :13
94
94
|
95
95
LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () {
96
96
| ------------------- this data with lifetime `'a`...
97
97
LL | val.use_self()
98
98
| ^^^^^^^^ ...is used and required to live as long as `'static` here
99
99
|
100
100
note: the used `impl` has a `'static` requirement
101
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:31 :26
101
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:36 :26
102
102
|
103
103
LL | impl MyTrait for dyn ObjectTrait {
104
104
| ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
@@ -110,15 +110,15 @@ LL | impl MyTrait for dyn ObjectTrait + '_ {
110
110
| ++++
111
111
112
112
error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
113
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:54 :13
113
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:59 :13
114
114
|
115
115
LL | fn use_it<'a>(val: &'a Box<dyn ObjectTrait + 'a>) -> &'a () {
116
116
| ----------------------------- this data with lifetime `'a`...
117
117
LL | val.use_self()
118
118
| ^^^^^^^^ ...is used and required to live as long as `'static` here
119
119
|
120
120
note: the used `impl` has a `'static` requirement
121
- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:48 :30
121
+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:53 :30
122
122
|
123
123
LL | impl MyTrait for Box<dyn ObjectTrait> {
124
124
| ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
0 commit comments