From ff8386e6cabce3f75898bde4bec38b465ff6bdfd Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Tue, 31 Dec 2024 13:53:51 -0500 Subject: [PATCH] Fix conditional attributes in exported allocator name. `#[export_name]` already takes precedence over `#[no_mangle]`, so this is a no-op, but it silences the warning. Found with nightly. Signed-off-by: Piotr Sikora --- src/allocator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/allocator.rs b/src/allocator.rs index aef28f5a..852d0194 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -18,7 +18,7 @@ use std::mem::MaybeUninit; all(target_arch = "wasm32", target_os = "unknown"), export_name = "malloc" )] -#[no_mangle] +#[cfg_attr(not(all(target_arch = "wasm32", target_os = "unknown")), no_mangle)] pub extern "C" fn proxy_on_memory_allocate(size: usize) -> *mut u8 { let mut vec: Vec> = Vec::with_capacity(size); unsafe {