typestate-rs
typestate-rs copied to clipboard
The macro should be able to export diagrams even if the state machine fails verification
Having the machine export diagrams is a feature useful as documentation but also as a debugging tool. Allowing the macro to export diagrams before verification would help debugging
The problem starts here: https://github.com/rustype/typestate-rs/blob/9799ae1bccf46ef5039709d7b411833304491e88/typestate-proc-macro/src/lib.rs#L75-L91 While bailing early is useful to avoid processing malformed state machines, we still want to able to look at them, hence we must build them regardless and only run validations in the end.