Files
hsmc/hsmc-macros/tests/ui/t10_2_during_overlap_same_state.rs
swaits 0341cf9379 initial commit: hsmc v0.2 with during: activities
Hierarchical statechart codegen for Rust with:
- during: activities for state-scoped concurrent I/O
- field-list borrowing (split-borrow inside the run loop)
- embassy-first async with tokio support
- STATE_CHART const for tooling/inspection
- examples: microwave, microwave_tui, embassy_full, during_radio
2026-04-16 13:03:03 -06:00

32 lines
533 B
Rust

//! t10.2: two `during:` declarations on the same state borrowing the same
//! field produce a clear macro-level error.
use hsmc::statechart;
#[derive(Debug, Clone)]
pub enum Ev { Halt }
pub struct Ctx {
pub a: u32,
}
statechart! {
M {
context: Ctx;
events: Ev;
default(S);
terminate(Halt);
state S {
during: one(a);
during: two(a);
}
}
}
async fn one(_: &mut u32) -> Ev { Ev::Halt }
async fn two(_: &mut u32) -> Ev { Ev::Halt }
impl MActions for MActionContext<'_> {}
fn main() {}