small tweaks

This commit is contained in:
Esteban Küber 2020-06-02 16:05:48 -07:00
parent 34d8692262
commit e31367de6b
10 changed files with 30 additions and 31 deletions

View file

@ -47,7 +47,7 @@ note: ...and is required to live as long as `'static` here
|
LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
| ^^^^^^^^^^^^^^^^^^^
help: consider changing the `impl Trait`'s explicit `'static` bound to argument `x`
help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn elided2(x: &i32) -> impl Copy + '_ { x }
| ^^
@ -69,7 +69,7 @@ note: ...and is required to live as long as `'static` here
|
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
| ^^^^^^^^^^^^^^^^^^^
help: consider changing the `impl Trait`'s explicit `'static` bound to argument `x`
help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x }
| ^^
@ -97,7 +97,7 @@ note: ...and is required to live as long as `'static` here
|
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider changing the `impl Trait`'s explicit `'static` bound to argument `x`
help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x }
| ^^
@ -157,7 +157,7 @@ LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
| |
| this data with an anonymous lifetime `'_`...
|
help: consider changing the trait object's explicit `'static` bound to argument `x`
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn elided4(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
| ^^
@ -172,7 +172,7 @@ error[E0758]: cannot infer an appropriate lifetime
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
| ------- this data with lifetime `'a`... ^ ...is captured here, requiring it to live as long as `'static`
|
help: consider changing the trait object's explicit `'static` bound to argument `x`
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
| ^^