diff --git a/cli/assets/templates/rust/src/lib.rs b/cli/assets/templates/rust/src/lib.rs index d1c7f303..8bcd496b 100644 --- a/cli/assets/templates/rust/src/lib.rs +++ b/cli/assets/templates/rust/src/lib.rs @@ -1,3 +1,4 @@ +#![no_std] #[cfg(feature = "buddy-alloc")] mod alloc; mod wasm4; diff --git a/cli/assets/templates/rust/src/wasm4.rs b/cli/assets/templates/rust/src/wasm4.rs index 7f04e61c..2af2f0f8 100644 --- a/cli/assets/templates/rust/src/wasm4.rs +++ b/cli/assets/templates/rust/src/wasm4.rs @@ -225,3 +225,8 @@ extern "C" { #[link_name = "traceUtf8"] fn extern_trace(trace: *const u8, length: usize); } + +#[panic_handler] +fn panic(_info: &core::panic::PanicInfo) -> ! { + core::arch::wasm32::unreachable(); +} \ No newline at end of file