Crates.io | no-mangle-if-debug |
lib.rs | no-mangle-if-debug |
version | 0.1.0 |
source | src |
created_at | 2022-08-11 14:56:37.413002 |
updated_at | 2022-08-11 14:56:37.413002 |
description | Attribute macro that does #[no_mangle] only in debug mode. |
homepage | https://github.com/rksm/hot-lib-reloader-rs |
repository | https://github.com/rksm/hot-lib-reloader-rs |
max_upload_size | |
id | 643373 |
size | 5,241 |
Will add #[no_mangle]
to the item it is applied but only in debug mode.
This is useful for use with hot-lib-reloader to conditionally expose library functions to the lib reloader only in debug mode. In release mode where a build is to be expected fully static, no additional penalty is paid.
#[no_mangle_if_debug]
fn func() {}
will expand to
#[cfg(debug_assertions)]
#[no_mangle]
fn func() {}
#[cfg(not(debug_assertions))]
fn func() {}
MIT