Improve 'dropped here' note.

Start mentioning function name that the variable is valid within in
notes to provide context.
This commit is contained in:
David Wood 2018-09-14 23:13:24 +02:00
parent 9eb8d1179c
commit 876774bf71
No known key found for this signature in database
GPG key ID: 01760B4F9F53F154
7 changed files with 25 additions and 9 deletions

View file

@ -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