-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable debug_assertions
won't ingore function calls in debug!(..)
statements.
#84
Comments
It's due to the "Avoid unused warnings. ". Try this:
|
Why execute functions (or cost cycles) when no log outputs are required? I think it is a bug. |
It was to avoid a warning here in release build that Maybe you should fix the template instead. Then you don't need the drop. |
Sorry, I didn’t get you. Did you meaning I should remove the In fact, my final goal is disabling any function calls in the They just waste cycles. If you allowed, I could push a PR to remove the |
I think using drop in debug macro is wrong, for example, this code doesn't compiling:
|
resolved by #98 |
I mean you should modify the template to maybe
Or like what quake wrote which uses the |
I think that my code snippet doesn't compiling when debug assertions is disabled, we should remove the |
Yeah, I mean how to avoid the warning when the |
Issue
I have the following code:
When set
debug_assertions = false
, the above could NOT be compiled.Description
When users don't want to print the debug messages, all functions in
debug!(..)
, such asscript_hash.pack()
in above code, should be ignored and they should never be executed.ckb-std/src/debug.rs
Lines 38 to 44 in 6764555
The text was updated successfully, but these errors were encountered: