From 2fe2728fa900a708d2c70342d9d6737e5462cf5d Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sun, 26 Dec 2021 14:25:39 +0100 Subject: [PATCH] Remove the lazy_static dependency from rustbuild Rustbuild already depends on once_cell which in the future can be replaced with std::lazy::Lazy. --- Cargo.lock | 1 - src/bootstrap/Cargo.toml | 1 - src/bootstrap/cache.rs | 7 +++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 959c8161e98..b7148883704 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -175,7 +175,6 @@ dependencies = [ "filetime", "getopts", "ignore", - "lazy_static", "libc", "merge", "num_cpus", diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index 1ce1f0b26db..9ad453497f6 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -44,7 +44,6 @@ libc = "0.2" serde = { version = "1.0.8", features = ["derive"] } serde_json = "1.0.2" toml = "0.5" -lazy_static = "1.3.0" time = "0.1" ignore = "0.4.10" opener = "0.5" diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs index 0c16fae01bc..fac5d8db511 100644 --- a/src/bootstrap/cache.rs +++ b/src/bootstrap/cache.rs @@ -13,7 +13,8 @@ use std::ops::Deref; use std::path::{Path, PathBuf}; use std::sync::Mutex; -use lazy_static::lazy_static; +// FIXME: replace with std::lazy after it gets stabilized and reaches beta +use once_cell::sync::Lazy; use crate::builder::Step; @@ -222,9 +223,7 @@ impl Interner { } } -lazy_static! { - pub static ref INTERNER: Interner = Interner::default(); -} +pub static INTERNER: Lazy = Lazy::new(Interner::default); /// This is essentially a `HashMap` which allows storing any type in its input and /// any type in its output. It is a write-once cache; values are never evicted,