From f8a3a7ebf3fc8a4ee8423b094f64d7fd1ac7b647 Mon Sep 17 00:00:00 2001 From: flemming-it Date: Thu, 30 Apr 2026 00:45:43 +0200 Subject: [PATCH] fix(lib): allow unsafe_op_in_unsafe_fn on wasm32 for wit_bindgen 0.36 Same suppression as in fai/platform's modules/echo: wit_bindgen 0.36's export! macro expands into unsafe fns whose bodies call further unsafe fns without explicit unsafe blocks, and Rust 2024 makes that an error under -D warnings. Drop once wit_bindgen ships a fix. Gated on target_arch wasm32 so the host build (tests, plan validation) stays strict. Signed-off-by: flemming-it --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 5abecd3..45f0d2e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,14 @@ //! to the deterministic stub from v0.1.0 — useful for tests and //! for environments where no LLM is reachable. +// wit_bindgen 0.36's `export!` macro expands into unsafe fns +// whose bodies call further unsafe fns without explicit unsafe +// blocks — Rust 2024's `unsafe_op_in_unsafe_fn` lint flags +// those, and CI runs with -D warnings. Suppress on wasm32 only +// so the host build stays strict. Drop this once wit_bindgen +// ships a fix. +#![cfg_attr(target_arch = "wasm32", allow(unsafe_op_in_unsafe_fn))] + mod llm; mod plan;