Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 867 Bytes

File metadata and controls

38 lines (27 loc) · 867 Bytes
tags cyber, rs, reference

Step Errors (RS401)

Back to Error Catalog | Spec: step.md

Enforcement: rsc lint (rs edition only).


RS401: Step state outside cell context

error[RS401]: #[step] state accessed outside of cell context
  help: #[step] state must be accessed within a cell! block
  help: step reset is managed by the cell runtime

#[step] state is automatically reset at step boundaries by the cell runtime. Accessing it outside a cell context means no runtime manages its lifecycle — the reset would never happen, defeating the purpose of step scoping.

Fix

Access step state from within a cell:

cell! {
    name: MyCell,
    step_state {
        counter: u64,
    }

    pub fn tick(&mut self) {
        self.step_state.counter += 1;  // OK: inside cell context
    }
}