Introduce more appropriate assertion mechanism

rust-analyzer is a long-running program, so we *should* handle assertion
failures.

See also https://www.sqlite.org/assert.html.
This commit is contained in:
Aleksey Kladov 2021-01-14 18:25:19 +03:00
parent 865e05b5b4
commit 8dc68ecdfc
8 changed files with 72 additions and 7 deletions

View file

@ -4,6 +4,8 @@ use std::{cmp::Ordering, ops, process, time::Instant};
mod macros;
pub mod panic_context;
pub use crate::macros::{on_assert_failure, set_assert_hook};
#[inline(always)]
pub fn is_ci() -> bool {
option_env!("CI").is_some()