S0060: use of moved value
Generated from rellum-diagnostics/src/db.rs.
Explanation
Once a Move value has been consumed by an expression, it no longer exists. Using it again in a later binding would access freed or invalid memory. The compiler tracks consumption sequentially through binding expressions.
Common causes
- a String passed to a function and then referenced again
- an array moved in one binding and indexed in a later binding
Canonical fixes
- restructure the computation to use the value once
- use share() if the value genuinely needs to be in two places
Before:
a = consume(data)
b = also_consume(data)
After:
a = consume(share(data))
b = also_consume(share(data))
Code example
a = consume(data)
b = also_consume(data)