Skip to content

Commit 67f1643

Browse files
authored
Rollup merge of #76075 - marmeladema:remove-once-cell-crate, r=matklad
datastructures: replace `once_cell` crate with an impl from std Fixes #75700 r? @matklad We might need a perf run for this change.
2 parents 7d2460e + 68500ff commit 67f1643

File tree

8 files changed

+7
-4
lines changed

8 files changed

+7
-4
lines changed

Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -3420,7 +3420,6 @@ dependencies = [
34203420
"lazy_static",
34213421
"libc",
34223422
"measureme",
3423-
"once_cell",
34243423
"parking_lot 0.10.2",
34253424
"rustc-hash",
34263425
"rustc-rayon",

compiler/rustc_data_structures/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ indexmap = "1.5.1"
1313
tracing = "0.1"
1414
jobserver_crate = { version = "0.1.13", package = "jobserver" }
1515
lazy_static = "1"
16-
once_cell = { version = "1", features = ["parking_lot"] }
1716
rustc_serialize = { path = "../rustc_serialize" }
1817
rustc_macros = { path = "../rustc_macros" }
1918
rustc_graphviz = { path = "../rustc_graphviz" }

compiler/rustc_data_structures/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#![feature(extend_one)]
2727
#![feature(const_panic)]
2828
#![feature(const_generics)]
29+
#![feature(once_cell)]
2930
#![allow(rustc::default_hash_types)]
3031

3132
#[macro_use]

compiler/rustc_data_structures/src/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ cfg_if! {
229229
pub use std::cell::RefMut as LockGuard;
230230
pub use std::cell::RefMut as MappedLockGuard;
231231

232-
pub use once_cell::unsync::OnceCell;
232+
pub use std::lazy::OnceCell;
233233

234234
use std::cell::RefCell as InnerRwLock;
235235
use std::cell::RefCell as InnerLock;
@@ -314,7 +314,7 @@ cfg_if! {
314314
pub use parking_lot::MutexGuard as LockGuard;
315315
pub use parking_lot::MappedMutexGuard as MappedLockGuard;
316316

317-
pub use once_cell::sync::OnceCell;
317+
pub use std::lazy::SyncOnceCell as OnceCell;
318318

319319
pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32, AtomicU64};
320320

compiler/rustc_driver/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
88
#![feature(nll)]
9+
#![feature(once_cell)]
910
#![recursion_limit = "256"]
1011

1112
#[macro_use]

compiler/rustc_interface/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#![feature(nll)]
55
#![feature(generator_trait)]
66
#![feature(generators)]
7+
#![feature(once_cell)]
78
#![recursion_limit = "256"]
89

910
mod callbacks;

compiler/rustc_middle/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#![feature(exhaustive_patterns)]
3939
#![feature(extern_types)]
4040
#![feature(nll)]
41+
#![feature(once_cell)]
4142
#![feature(option_expect_none)]
4243
#![feature(or_patterns)]
4344
#![feature(min_specialization)]

compiler/rustc_session/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(crate_visibility_modifier)]
2+
#![feature(once_cell)]
23
#![feature(or_patterns)]
34

45
#[macro_use]

0 commit comments

Comments
 (0)