Skip to content

Commit c502d38

Browse files
authored
Fix conditional attributes in exported allocator name. (#299)
`#[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 <[email protected]>
1 parent e71c1af commit c502d38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/allocator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::mem::MaybeUninit;
1818
all(target_arch = "wasm32", target_os = "unknown"),
1919
export_name = "malloc"
2020
)]
21-
#[no_mangle]
21+
#[cfg_attr(not(all(target_arch = "wasm32", target_os = "unknown")), no_mangle)]
2222
pub extern "C" fn proxy_on_memory_allocate(size: usize) -> *mut u8 {
2323
let mut vec: Vec<MaybeUninit<u8>> = Vec::with_capacity(size);
2424
unsafe {

0 commit comments

Comments
 (0)