S0133: cannot borrow moved value
Generated from rellum-diagnostics/src/db.rs.
Explanation
After a Move value is consumed, the original binding no longer owns valid storage. Borrowing it would create a reference to a value that has already transferred ownership.
Common causes
- calling a consuming function and then borrowing the argument
- moving a local into another value before taking a reference to it
- using a moved event payload after an owned consumer
Canonical fixes
- borrow the value before it is moved, and keep the borrow's use before the move
Before:
x = consume(buf)
r = &buf
After:
r = &buf
n = len(r)
x = consume(buf)
- use share() when multiple owned-looking consumers need tick-scoped access
Code example
x = consume(buf)
r = &buf