Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests.rs')
-rw-r--r--crates/hir-ty/src/tests.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir-ty/src/tests.rs b/crates/hir-ty/src/tests.rs
index 0fcd789f76..eded786a64 100644
--- a/crates/hir-ty/src/tests.rs
+++ b/crates/hir-ty/src/tests.rs
@@ -12,6 +12,7 @@ mod traits;
mod type_alias_impl_traits;
use std::env;
+use std::sync::LazyLock;
use base_db::SourceDatabaseFileInputExt as _;
use expect_test::Expect;
@@ -25,7 +26,6 @@ use hir_def::{
AssocItemId, DefWithBodyId, HasModule, LocalModuleId, Lookup, ModuleDefId,
};
use hir_expand::{db::ExpandDatabase, FileRange, InFile};
-use once_cell::race::OnceBool;
use rustc_hash::FxHashMap;
use stdx::format_to;
use syntax::{
@@ -50,8 +50,8 @@ use crate::{
// `env UPDATE_EXPECT=1 cargo test -p hir_ty` to update the snapshots.
fn setup_tracing() -> Option<tracing::subscriber::DefaultGuard> {
- static ENABLE: OnceBool = OnceBool::new();
- if !ENABLE.get_or_init(|| env::var("CHALK_DEBUG").is_ok()) {
+ static ENABLE: LazyLock<bool> = LazyLock::new(|| env::var("CHALK_DEBUG").is_ok());
+ if !*ENABLE {
return None;
}