Migrate most of wasmtime from lazy_static to once_cell (#4368)
* Update tracing-core to a version which doesn't depend on lazy-static. * Update crossbeam-utils to a version that doesn't depend on lazy-static. * Update crossbeam-epoch to a version that doesn't depend on lazy-static. * Update clap to a version that doesn't depend on lazy-static. * Convert Wasmtime's own use of lazy_static to once_cell. * Make `GDB_REGISTRATION`'s comment a doc comment. * Fix compilation on Windows.
This commit is contained in:
@@ -29,7 +29,7 @@ is-terminal = "0.3.0"
|
||||
rustix = { version = "0.35.6", features = ["fs"] }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
lazy_static = "1.4"
|
||||
once_cell = "1.12.0"
|
||||
io-extras = "0.15.0"
|
||||
|
||||
[target.'cfg(windows)'.dependencies.windows-sys]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
// taken the time to improve it. See bug #2880.
|
||||
|
||||
use anyhow::Context;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::ops::Deref;
|
||||
use std::sync::mpsc::{self, Receiver, RecvTimeoutError, Sender, TryRecvError};
|
||||
use std::sync::Mutex;
|
||||
@@ -145,9 +146,7 @@ struct StdinPoll {
|
||||
notify_rx: Receiver<PollState>,
|
||||
}
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref STDIN_POLL: Mutex<StdinPoll> = StdinPoll::new();
|
||||
}
|
||||
static STDIN_POLL: Lazy<Mutex<StdinPoll>> = Lazy::new(StdinPoll::new);
|
||||
|
||||
impl StdinPoll {
|
||||
pub fn new() -> Mutex<Self> {
|
||||
|
||||
Reference in New Issue
Block a user