2020-06-26 18:52:00 -07:00
|
|
|
error[E0759]: cannot infer an appropriate lifetime
|
2020-06-28 15:26:12 -07:00
|
|
|
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:20:13
|
2020-06-26 18:52:00 -07:00
|
|
|
|
|
|
|
|
LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
|
|
|
|
| ------------------- this data with lifetime `'a`...
|
|
|
|
LL | val.use_self()
|
|
|
|
| ^^^^^^^^ ...is captured and required to live as long as `'static` here
|
|
|
|
|
|
|
|
|
help: this `impl` introduces an implicit `'static` requirement, consider changing it
|
|
|
|
|
|
|
|
|
LL | impl MyTrait for dyn ObjectTrait + '_ {
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error[E0759]: cannot infer an appropriate lifetime
|
2020-06-28 15:26:12 -07:00
|
|
|
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69:13
|
|
|
|
|
|
|
|
|
LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
|
|
|
|
| ------------------- this data with lifetime `'a`...
|
|
|
|
LL | val.use_self()
|
|
|
|
| ^^^^^^^^ ...is captured and required to live as long as `'static` here
|
|
|
|
|
|
|
|
|
help: this `impl` introduces an implicit `'static` requirement, consider changing it
|
|
|
|
|
|
|
|
|
LL | impl dyn ObjectTrait + '_ {
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error[E0759]: cannot infer an appropriate lifetime
|
|
|
|
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:37:13
|
2020-06-26 18:52:00 -07:00
|
|
|
|
|
|
|
|
LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () {
|
|
|
|
| ------------------- this data with lifetime `'a`...
|
|
|
|
LL | val.use_self()
|
|
|
|
| ^^^^^^^^ ...is captured and required to live as long as `'static` here
|
|
|
|
|
|
|
|
|
help: this `impl` introduces an implicit `'static` requirement, consider changing it
|
|
|
|
|
|
|
|
|
LL | impl MyTrait for dyn ObjectTrait + '_ {
|
|
|
|
| ^^^^
|
|
|
|
|
2020-06-28 15:26:12 -07:00
|
|
|
error[E0759]: cannot infer an appropriate lifetime
|
|
|
|
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:54:13
|
|
|
|
|
|
|
|
|
LL | fn use_it<'a>(val: &'a Box<dyn ObjectTrait + 'a>) -> &'a () {
|
|
|
|
| ----------------------------- this data with lifetime `'a`...
|
|
|
|
LL | val.use_self()
|
|
|
|
| ^^^^^^^^ ...is captured and required to live as long as `'static` here
|
|
|
|
|
|
|
|
|
help: this `impl` introduces an implicit `'static` requirement, consider changing it
|
|
|
|
|
|
|
|
|
LL | impl MyTrait for Box<dyn ObjectTrait + '_> {
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
2020-06-26 18:52:00 -07:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0759`.
|