diff options
| author | bors <bors@rust-lang.org> | 2023-09-02 03:06:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-09-02 03:06:11 +0000 |
| commit | 9dc11a13fa848c1b09b7248c540528190dcb79c5 (patch) | |
| tree | e98a3b294cebc0ae4d88cb08bb035bb8e7303af7 /compiler/rustc_interface/src/passes.rs | |
| parent | f9ba43ce147707fb90d038983789d8e57451eb6d (diff) | |
| parent | 90f5f94699c431d0def5776388ff42da908e54f8 (diff) | |
| download | rust-9dc11a13fa848c1b09b7248c540528190dcb79c5.tar.gz rust-9dc11a13fa848c1b09b7248c540528190dcb79c5.zip | |
Auto merge of #115422 - Zoxc:cache-once-lock, r=cjgillot
Use `OnceLock` for `SingleCache` This uses `OnceLock` for `SingleCache` instead of `Lock<Option<T>>` so lookups are lock-free. r? `@cjgillot`
Diffstat (limited to 'compiler/rustc_interface/src/passes.rs')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index c8b1ba5694e..9fcaf643179 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -8,7 +8,7 @@ use rustc_borrowck as mir_borrowck; use rustc_codegen_ssa::traits::CodegenBackend; use rustc_data_structures::parallel; use rustc_data_structures::steal::Steal; -use rustc_data_structures::sync::{Lrc, OnceCell, WorkerLocal}; +use rustc_data_structures::sync::{Lrc, OnceLock, WorkerLocal}; use rustc_errors::PResult; use rustc_expand::base::{ExtCtxt, LintStoreExpand}; use rustc_feature::Features; @@ -689,7 +689,7 @@ pub fn create_global_ctxt<'tcx>( lint_store: Lrc<LintStore>, dep_graph: DepGraph, untracked: Untracked, - gcx_cell: &'tcx OnceCell<GlobalCtxt<'tcx>>, + gcx_cell: &'tcx OnceLock<GlobalCtxt<'tcx>>, arena: &'tcx WorkerLocal<Arena<'tcx>>, hir_arena: &'tcx WorkerLocal<rustc_hir::Arena<'tcx>>, ) -> &'tcx GlobalCtxt<'tcx> { |
