@@ -47,7 +47,7 @@ note: ...and is required to live as long as `'static` here
47
47
|
48
48
LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
49
49
| ^^^^^^^^^^^^^^^^^^^
50
- help: consider changing the `impl Trait`'s explicit `'static` bound to argument `x`
50
+ help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
51
51
|
52
52
LL | fn elided2(x: &i32) -> impl Copy + '_ { x }
53
53
| ^^
@@ -69,7 +69,7 @@ note: ...and is required to live as long as `'static` here
69
69
|
70
70
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
71
71
| ^^^^^^^^^^^^^^^^^^^
72
- help: consider changing the `impl Trait`'s explicit `'static` bound to argument `x`
72
+ help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
73
73
|
74
74
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x }
75
75
| ^^
@@ -97,7 +97,7 @@ note: ...and is required to live as long as `'static` here
97
97
|
98
98
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
99
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
- help: consider changing the `impl Trait`'s explicit `'static` bound to argument `x`
100
+ help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
101
101
|
102
102
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x }
103
103
| ^^
@@ -157,7 +157,7 @@ LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
157
157
| |
158
158
| this data with an anonymous lifetime `'_`...
159
159
|
160
- help: consider changing the trait object's explicit `'static` bound to argument `x`
160
+ help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
161
161
|
162
162
LL | fn elided4(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
163
163
| ^^
@@ -172,7 +172,7 @@ error[E0758]: cannot infer an appropriate lifetime
172
172
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
173
173
| ------- this data with lifetime `'a`... ^ ...is captured here, requiring it to live as long as `'static`
174
174
|
175
- help: consider changing the trait object's explicit `'static` bound to argument `x`
175
+ help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
176
176
|
177
177
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
178
178
| ^^
0 commit comments