Make always-assert crate reusable

This commit is contained in:
Aleksey Kladov 2021-01-26 22:11:12 +03:00
parent 2664aee8e5
commit d35bda6429
11 changed files with 24 additions and 73 deletions

View file

@ -37,6 +37,7 @@ lsp-server = "0.5.0"
tracing = "0.1"
tracing-subscriber = { version = "0.2", default-features = false, features = ["env-filter", "registry"] }
tracing-tree = { version = "0.1.4" }
always-assert = "0.1"
stdx = { path = "../stdx", version = "0.0.0" }
flycheck = { path = "../flycheck", version = "0.0.0" }
@ -72,3 +73,4 @@ tt = { path = "../tt" }
[features]
jemalloc = ["jemallocator", "profile/jemalloc"]
force-always-assert = ["always-assert/force"]

View file

@ -75,15 +75,6 @@ fn setup_logging(log_file: Option<PathBuf>) -> Result<()> {
profile::init();
if !cfg!(debug_assertions) {
stdx::set_assert_hook(|loc, args| {
if env::var("RA_PROFILE").is_ok() {
panic!("assertion failed at {}: {}", loc, args)
}
log::error!("assertion failed at {}: {}", loc, args)
});
}
Ok(())
}