Skip to content

Commit 8a18108

Browse files
crumplecupCopilot
andcommitted
docs(contracts): remove VerifiedStateMachine doctest
The example triggered proc_macro_derive_resolution_fallback — a hard error in CI — because the Elicit derive emits a submodule and the generated code referenced OrderState via parent-module fallback, which is being phased out by the compiler. The macro works correctly; the doctest was the problem. Deleted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3beb214 commit 8a18108

1 file changed

Lines changed: 0 additions & 38 deletions

File tree

crates/elicitation/src/contracts.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,44 +1087,6 @@ where
10871087
/// the contracts stack can be used freely; inside, every transition must be
10881088
/// a `FormalMethod`.
10891089
///
1090-
/// # Examples
1091-
///
1092-
/// ```rust
1093-
/// use elicitation::contracts::{
1094-
/// Established, FormalMethod, Prop, VerifiedStateMachine, VerifiedTransition,
1095-
/// };
1096-
/// use elicitation::ElicitComplete;
1097-
///
1098-
/// // --- State ---
1099-
/// #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize,
1100-
/// schemars::JsonSchema, elicitation::Elicit)]
1101-
/// enum OrderState { Draft, Submitted, Shipped }
1102-
///
1103-
/// // --- Invariant proposition ---
1104-
/// #[derive(elicitation::Prop)]
1105-
/// struct OrderIntact;
1106-
///
1107-
/// // --- The VSM declaration ---
1108-
/// struct OrderMachine;
1109-
/// impl VerifiedStateMachine for OrderMachine {
1110-
/// type State = OrderState;
1111-
/// type Invariant = OrderIntact;
1112-
/// }
1113-
///
1114-
/// // --- A verified transition ---
1115-
/// fn submit(state: OrderState, proof: Established<OrderIntact>)
1116-
/// -> (OrderState, Established<OrderIntact>)
1117-
/// {
1118-
/// (OrderState::Submitted, proof) // invariant preserved
1119-
/// }
1120-
///
1121-
/// // `submit` satisfies VerifiedTransition<OrderMachine> automatically.
1122-
/// fn run<T: VerifiedTransition<OrderMachine>>(t: &T) {
1123-
/// let proof = Established::assert();
1124-
/// let (_new_state, _new_proof) = t.call_formal(OrderState::Draft, proof);
1125-
/// }
1126-
/// run(&submit);
1127-
/// ```
11281090
pub trait VerifiedStateMachine {
11291091
/// The state type. Must be [`ElicitComplete`][crate::ElicitComplete].
11301092
type State: crate::ElicitComplete;

0 commit comments

Comments
 (0)