Error code E0597
This error occurs because a value was dropped while it was still borrowed.
Erroneous code example:
ⓘ
Here, y
is dropped at the end of the inner scope, but it is borrowed by
x
until the println
. To fix the previous example, just remove the scope
so that y
isn't dropped until after the println