11error[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
33 |
44LL | fn use_it<'a, T>(val: &'a dyn ObjectTrait<T>) -> impl OtherTrait<'a> + 'a {
55 | ---------------------- this data with lifetime `'a`...
66LL | val.use_self::<T>()
77 | ^^^^^^^^ ...is used and required to live as long as `'static` here
88 |
99note: 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
1111 |
1212LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> {
1313 | ^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
@@ -19,15 +19,15 @@ LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> + '_ {
1919 | ++++
2020
2121error[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
2323 |
2424LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
2525 | ------------------- this data with lifetime `'a`...
2626LL | val.use_self()
2727 | ^^^^^^^^ ...is used and required to live as long as `'static` here because of an implicit lifetime bound on the inherent `impl`
2828 |
2929note: 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
3131 |
3232LL | impl dyn ObjectTrait {
3333 | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
@@ -39,15 +39,15 @@ LL | impl dyn ObjectTrait + '_ {
3939 | ++++
4040
4141error[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
4343 |
4444LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> {
4545 | ------------------- this data with lifetime `'a`...
4646LL | val.use_self()
4747 | ^^^^^^^^ ...is used and required to live as long as `'static` here
4848 |
4949note: 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
5151 |
5252LL | fn use_self(&self) -> &() { panic!() }
5353 | -------- 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 {
6464 | ++++
6565
6666error[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
6868 |
6969LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
7070 | ------------------- this data with lifetime `'a`...
7171LL | MyTrait::use_self(val)
7272 | ^^^ ...is used here...
7373 |
7474note: ...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
7676 |
7777LL | MyTrait::use_self(val)
7878 | ^^^^^^^^^^^^^^^^^
7979note: 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
8181 |
8282LL | fn use_self(&self) -> &() { panic!() }
8383 | -------- calling this method introduces the `impl`'s 'static` requirement
@@ -90,15 +90,15 @@ LL | impl MyTrait for dyn ObjectTrait + '_ {}
9090 | ++++
9191
9292error[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
9494 |
9595LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () {
9696 | ------------------- this data with lifetime `'a`...
9797LL | val.use_self()
9898 | ^^^^^^^^ ...is used and required to live as long as `'static` here
9999 |
100100note: 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
102102 |
103103LL | impl MyTrait for dyn ObjectTrait {
104104 | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
@@ -110,15 +110,15 @@ LL | impl MyTrait for dyn ObjectTrait + '_ {
110110 | ++++
111111
112112error[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
114114 |
115115LL | fn use_it<'a>(val: &'a Box<dyn ObjectTrait + 'a>) -> &'a () {
116116 | ----------------------------- this data with lifetime `'a`...
117117LL | val.use_self()
118118 | ^^^^^^^^ ...is used and required to live as long as `'static` here
119119 |
120120note: 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
122122 |
123123LL | impl MyTrait for Box<dyn ObjectTrait> {
124124 | ^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
0 commit comments