mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Make always-assert crate reusable
This commit is contained in:
parent
2664aee8e5
commit
d35bda6429
11 changed files with 24 additions and 73 deletions
|
@ -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"]
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue