bless
This commit is contained in:
parent
0f6e06b7c0
commit
9110911353
2 changed files with 5 additions and 5 deletions
|
|
@ -6,8 +6,8 @@ LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> i
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
...
|
||||
LL | x
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
LL | data.push(value);
|
||||
| ^^^^^^^^^^^^^^^^ argument requires that `'a` must outlive `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea
|
|||
--> $DIR/impl-trait-captures.rs:11:5
|
||||
|
|
||||
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
|
||||
| -- ^^^^^^^^^^^^
|
||||
| |
|
||||
| hidden type `&ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrAnon(0)) T` captures the anonymous lifetime defined here
|
||||
| -- hidden type `&ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrAnon(0)) T` captures the anonymous lifetime defined here
|
||||
LL | x
|
||||
| ^
|
||||
|
|
||||
help: to declare that the `impl Trait` captures `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrAnon(0))`, you can add an explicit `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrAnon(0))` lifetime bound
|
||||
|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue