Improve 'dropped here' note.
Start mentioning function name that the variable is valid within in notes to provide context.
This commit is contained in:
parent
9eb8d1179c
commit
876774bf71
7 changed files with 25 additions and 9 deletions
|
|
@ -10,7 +10,7 @@ LL | &x
|
|||
| ^^ `x` would have to be valid for `'y`
|
||||
LL | //~^ ERROR: `x` does not live long enough
|
||||
LL | }
|
||||
| - but `x` dropped here while still borrowed
|
||||
| - ...but `x` is only valid for the duration of the `silly` function, so it is dropped here while still borrowed
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue