Skip to content

Commit dfb1119

Browse files
committed
Replace once_cell with the newly stabilized std::sync::OnceLock
1 parent 4ef286c commit dfb1119

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ object = { version = "0.30.3", default-features = false, features = ["std", "rea
2727

2828
indexmap = "1.9.3"
2929
libloading = { version = "0.7.3", optional = true }
30-
once_cell = "1.10.0"
3130
smallvec = "1.8.1"
3231

3332
[patch.crates-io]

src/driver/jit.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use std::cell::RefCell;
55
use std::ffi::CString;
66
use std::os::raw::{c_char, c_int};
7-
use std::sync::{mpsc, Mutex};
7+
use std::sync::{mpsc, Mutex, OnceLock};
88

99
use rustc_codegen_ssa::CrateInfo;
1010
use rustc_middle::mir::mono::MonoItem;
@@ -13,9 +13,6 @@ use rustc_span::Symbol;
1313

1414
use cranelift_jit::{JITBuilder, JITModule};
1515

16-
// FIXME use std::sync::OnceLock once it stabilizes
17-
use once_cell::sync::OnceCell;
18-
1916
use crate::{prelude::*, BackendConfig};
2017
use crate::{CodegenCx, CodegenMode};
2118

@@ -29,7 +26,7 @@ thread_local! {
2926
}
3027

3128
/// The Sender owned by the rustc thread
32-
static GLOBAL_MESSAGE_SENDER: OnceCell<Mutex<mpsc::Sender<UnsafeMessage>>> = OnceCell::new();
29+
static GLOBAL_MESSAGE_SENDER: OnceLock<Mutex<mpsc::Sender<UnsafeMessage>>> = OnceLock::new();
3330

3431
/// A message that is sent from the jitted runtime to the rustc thread.
3532
/// Senders are responsible for upholding `Send` semantics.

0 commit comments

Comments
 (0)