Fix --release warnings

This commit is contained in:
Richard Feldman 2022-05-15 21:50:49 -04:00
parent 262b2fd24e
commit 9bc1e320dc
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
6 changed files with 70 additions and 37 deletions

View file

@ -15,10 +15,7 @@ use roc_constrain::module::{
constrain_builtin_imports, constrain_module, ExposedByModule, ExposedForModule,
ExposedModuleTypes,
};
use roc_debug_flags::{
dbg_do, ROC_PRINT_IR_AFTER_REFCOUNT, ROC_PRINT_IR_AFTER_RESET_REUSE,
ROC_PRINT_IR_AFTER_SPECIALIZATION, ROC_PRINT_LOAD_LOG,
};
use roc_debug_flags::dbg_do;
use roc_error_macros::internal_error;
use roc_module::ident::{Ident, ModuleName, QualifiedModuleName};
use roc_module::symbol::{
@ -57,6 +54,12 @@ use std::{env, fs};
use crate::work::Dependencies;
pub use crate::work::Phase;
#[cfg(debug_assertions)]
use roc_debug_flags::{
ROC_PRINT_IR_AFTER_REFCOUNT, ROC_PRINT_IR_AFTER_RESET_REUSE, ROC_PRINT_IR_AFTER_SPECIALIZATION,
ROC_PRINT_LOAD_LOG,
};
#[cfg(target_family = "wasm")]
use crate::wasm_system_time::{Duration, SystemTime};
#[cfg(not(target_family = "wasm"))]
@ -3873,7 +3876,9 @@ fn canonicalize_and_constrain<'a>(
..
} = parsed;
let before = roc_types::types::get_type_clone_count();
// NOTE: This is prefixed with underscore because it
// is unused in release builds.
let _before = roc_types::types::get_type_clone_count();
let mut var_store = VarStore::default();
let module_output = canonicalize_module_defs(
@ -3891,14 +3896,16 @@ fn canonicalize_and_constrain<'a>(
&mut var_store,
);
let after = roc_types::types::get_type_clone_count();
// NOTE: This is prefixed with underscore because it
// is unused in release builds.
let _after = roc_types::types::get_type_clone_count();
log!(
"canonicalize of {:?} cloned Type {} times ({} -> {})",
module_id,
after - before,
before,
after
_after - _before,
_before,
_after
);
let canonicalize_end = SystemTime::now();
@ -3921,7 +3928,9 @@ fn canonicalize_and_constrain<'a>(
}
};
let before = roc_types::types::get_type_clone_count();
// NOTE: This is prefixed with underscore because it
// is unused in release builds.
let _before = roc_types::types::get_type_clone_count();
let mut constraints = Constraints::new();
@ -3937,14 +3946,16 @@ fn canonicalize_and_constrain<'a>(
)
};
let after = roc_types::types::get_type_clone_count();
// NOTE: This is prefixed with underscore because it
// is unused in release builds.
let _after = roc_types::types::get_type_clone_count();
log!(
"constraint gen of {:?} cloned Type {} times ({} -> {})",
module_id,
after - before,
before,
after
_after - _before,
_before,
_after
);
// scope has imported aliases, but misses aliases from inner scopes