1
1
error[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
3
3
|
4
4
LL | fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrait<'a> {
5
5
| -- 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
14
14
| ^^^^
15
15
16
16
error[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
18
18
|
19
19
LL | val.use_self()
20
20
| ---^^^^^^^^^^^
@@ -23,24 +23,24 @@ LL | val.use_self()
23
23
| `val` is borrowed here
24
24
25
25
error[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
27
27
|
28
28
LL | val.use_self()
29
29
| ---^^^^^^^^^^^
30
30
| |
31
31
| returns a value referencing data owned by the current function
32
32
| `val` is borrowed here
33
33
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
36
36
|
37
37
LL | fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32> + 'a>) -> &'a () {
38
38
| -------------------------------------- this data with lifetime `'a`...
39
39
LL | val.use_self()
40
40
| ^^^^^^^^ ...is captured and required to live as long as `'static` here
41
41
|
42
42
note: 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
44
44
|
45
45
LL | impl MyTrait for Box<dyn ObjectTrait<Assoc = i32>> {
46
46
| ^^^^^^^^^^^^^^^^^^^^^^^^ this has an implicit `'static` lifetime requirement
0 commit comments