Skip to main content

turso_assert_unreachable

Macro turso_assert_unreachable 

Source
turso_assert_unreachable!() { /* proc-macro */ }
Expand description

Asserts that a code path is never reached. This is a hard assertion — it will terminate the program if the path is executed.

Maps to antithesis_sdk::assert_unreachable!.

§Behavior

  • Without antithesis feature: calls [unreachable!] (panics with the message).
  • With antithesis feature: reports to Antithesis via assert_unreachable!, prints the error, then calls exit(0).

§Parameters

  • "message" — human-readable description of why this path is unreachable (required).
  • { "key": value, ... } (optional) — structured details for Antithesis and the panic/exit message.

§Usage

ⓘ
turso_assert_unreachable!("message");
turso_assert_unreachable!("message", { "key": value });

§When to use

Use for code paths that represent logic errors — places that should genuinely never execute. For paths that are unexpected but not impossible (e.g., fallback branches that indicate a likely bug but shouldn’t panic), prefer turso_soft_unreachable! instead.