S0065: committed state value moved in effect body
Generated from rellum-diagnostics/src/db.rs.
Explanation
~ state values are committed to globals at the end of Advance and persist across ticks. They are owned by the tick runtime, not by the effect body. Moving a committed state value in an effect body would leave the state slot in an invalid state for the next tick's Observe phase.
Common causes
- passing ~ state to a function that takes ownership in an effect argument
- using ~ state as the right operand of string or array concatenation in an effect
Canonical fixes
- wrap in share() to create a tick-scoped handle
Before:
send!(socket, encode(history))
After:
send!(socket, encode(share(history)))
Code example
send!(socket, encode(history))