From be8d84651e92dbe4348fb7349e466c8eaba77586 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Mon, 27 Sep 2021 12:53:48 +0100 Subject: [PATCH] Calling an unsafe fn so need to have an unsafe block --- primitives/io/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/primitives/io/src/lib.rs b/primitives/io/src/lib.rs index 78e6f0c847952..9a8ebf6552109 100644 --- a/primitives/io/src/lib.rs +++ b/primitives/io/src/lib.rs @@ -1484,7 +1484,7 @@ mod allocator_impl { pub fn panic(info: &core::panic::PanicInfo) -> ! { let message = sp_std::alloc::format!("{}", info); logging::log(LogLevel::Error, "runtime", message.as_bytes()); - core::arch::wasm32::unreachable(); + unsafe { core::arch::wasm32::unreachable() }; } /// A default OOM handler for WASM environment. @@ -1492,7 +1492,7 @@ pub fn panic(info: &core::panic::PanicInfo) -> ! { #[alloc_error_handler] pub fn oom(_: core::alloc::Layout) -> ! { logging::log(LogLevel::Error, "runtime", b"Runtime memory exhausted. Aborting"); - core::arch::wasm32::unreachable(); + unsafe { core::arch::wasm32::unreachable() }; } /// Type alias for Externalities implementation used in tests.