11error[E0597]: `val` does not live long enough
2- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:22 :9
2+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:21 :9
33 |
44LL | fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrait<'a> {
55 | -- lifetime `'a` defined here ------------------- opaque type requires that `val` is borrowed for `'a`
@@ -14,7 +14,7 @@ LL | fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrai
1414 | ^^^^
1515
1616error[E0515]: cannot return value referencing function parameter `val`
17- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:44 :9
17+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:43 :9
1818 |
1919LL | val.use_self()
2020 | ---^^^^^^^^^^^
@@ -23,24 +23,24 @@ LL | val.use_self()
2323 | `val` is borrowed here
2424
2525error[E0515]: cannot return value referencing function parameter `val`
26- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:110 :9
26+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:109 :9
2727 |
2828LL | val.use_self()
2929 | ---^^^^^^^^^^^
3030 | |
3131 | returns a value referencing data owned by the current function
3232 | `val` is borrowed here
3333
34- error[E0767 ]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
35- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:67 :13
34+ error[E0772 ]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
35+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:66 :13
3636 |
3737LL | fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32> + 'a>) -> &'a () {
3838 | -------------------------------------- this data with lifetime `'a`...
3939LL | val.use_self()
4040 | ^^^^^^^^ ...is captured and required to live as long as `'static` here
4141 |
4242note: the used `impl` has a `'static` requirement
43- --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:61 :30
43+ --> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:60 :30
4444 |
4545LL | impl MyTrait for Box<dyn ObjectTrait<Assoc = i32>> {
4646 | ^^^^^^^^^^^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
0 commit comments