aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-22 15:58:50 +0000
committerAleksey Kladov <[email protected]>2021-01-22 16:13:21 +0000
commit02a17cdffcfdea49981b4642be3027e564d28d9b (patch)
tree085dbaa97ae9c6c3d72e4902aafcb4ddf8717321 /crates
parentb16add934d3cb4817ec0f20b8697a4d9701fce4e (diff)
Make assertion failures more annoying for maintainers
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/bin/main.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/bin/main.rs b/crates/rust-analyzer/src/bin/main.rs
index 2f7f94a39..1d6e5478b 100644
--- a/crates/rust-analyzer/src/bin/main.rs
+++ b/crates/rust-analyzer/src/bin/main.rs
@@ -76,7 +76,12 @@ fn setup_logging(log_file: Option<PathBuf>) -> Result<()> {
76 profile::init(); 76 profile::init();
77 77
78 if !cfg!(debug_assertions) { 78 if !cfg!(debug_assertions) {
79 stdx::set_assert_hook(|loc, args| log::error!("assertion failed at {}: {}", loc, args)); 79 stdx::set_assert_hook(|loc, args| {
80 if env::var("RA_PROFILE").is_ok() {
81 panic!("assertion failed at {}: {}", loc, args)
82 }
83 log::error!("assertion failed at {}: {}", loc, args)
84 });
80 } 85 }
81 86
82 Ok(()) 87 Ok(())