diff --git a/lib/binding_rust/util.rs b/lib/binding_rust/util.rs index 3480c02d..1a4ac1b7 100644 --- a/lib/binding_rust/util.rs +++ b/lib/binding_rust/util.rs @@ -4,7 +4,7 @@ extern "C" { /// In *Release* builds, the C library links directly against `malloc` and `free`. /// /// When freeing memory that was allocated by C code, use `free` directly. - #[cfg(not(test))] + #[cfg(not(debug_assertions))] #[link_name = "free"] pub fn free_ptr(ptr: *mut c_void); @@ -15,7 +15,7 @@ extern "C" { /// /// When freeing memory that was allocated by C code, use the `free` function /// from that module. - #[cfg(test)] + #[cfg(debug_assertions)] #[link_name = "ts_record_free"] pub fn free_ptr(ptr: *mut c_void);