mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
Fix debug flags for release mode
This commit is contained in:
parent
a8b55dc794
commit
76a3e92088
2 changed files with 14 additions and 8 deletions
|
@ -35,21 +35,27 @@
|
|||
|
||||
#[macro_export]
|
||||
macro_rules! dbg_set {
|
||||
($flag:path) => {
|
||||
if !cfg!(debug_assertions) {
|
||||
($flag:path) => {{
|
||||
#[cfg(not(debug_assertions))]
|
||||
{
|
||||
false
|
||||
} else {
|
||||
}
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
let flag = std::env::var($flag);
|
||||
!flag.is_err() && flag.as_deref() != Ok("0")
|
||||
}
|
||||
};
|
||||
}};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! dbg_do {
|
||||
($flag:path, $expr:expr) => {
|
||||
if $crate::dbg_set!($flag) {
|
||||
$expr
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
if $crate::dbg_set!($flag) {
|
||||
$expr
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use bitflags::bitflags;
|
||||
use roc_collections::{VecMap, VecSet};
|
||||
use roc_debug_flags::{dbg_do, dbg_set, ROC_VERIFY_OCCURS_RECURSION};
|
||||
use roc_debug_flags::{dbg_do, dbg_set};
|
||||
#[cfg(debug_assertions)]
|
||||
use roc_debug_flags::{ROC_PRINT_MISMATCHES, ROC_PRINT_UNIFICATIONS};
|
||||
use roc_debug_flags::{ROC_PRINT_MISMATCHES, ROC_PRINT_UNIFICATIONS, ROC_VERIFY_OCCURS_RECURSION};
|
||||
use roc_error_macros::internal_error;
|
||||
use roc_module::ident::{Lowercase, TagName};
|
||||
use roc_module::symbol::{ModuleId, Symbol};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue