From efe7cf468f39e810b22e2779f4fafe976e74e563 Mon Sep 17 00:00:00 2001 From: John Kåre Alsaker Date: Fri, 10 Feb 2023 03:04:48 +0100 Subject: Remove WorkerLocal from AttrIdGenerator --- compiler/rustc_interface/src/interface.rs | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'compiler/rustc_interface/src') diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index 577a1034307..be7fa9378ca 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -19,7 +19,6 @@ use rustc_session::Session; use rustc_session::{early_error, CompilerIO}; use rustc_span::source_map::{FileLoader, FileName}; use rustc_span::symbol::sym; -use std::cell::OnceCell; use std::path::PathBuf; use std::result; @@ -59,25 +58,9 @@ impl Compiler { } } -fn registry_setup() { - thread_local! { - static ONCE: OnceCell<()> = OnceCell::new(); - } - - // Create a dummy registry to allow `WorkerLocal` construction. - // We use `OnceCell` so we only register one dummy registry per thread. - ONCE.with(|once| { - once.get_or_init(|| { - rustc_data_structures::sync::Registry::new(1).register(); - }); - }); -} - /// Converts strings provided as `--cfg [cfgspec]` into a `crate_cfg`. pub fn parse_cfgspecs(cfgspecs: Vec) -> FxHashSet<(String, Option)> { rustc_span::create_default_session_if_not_set_then(move |_| { - registry_setup(); - let cfg = cfgspecs .into_iter() .map(|s| { @@ -137,8 +120,6 @@ pub fn parse_cfgspecs(cfgspecs: Vec) -> FxHashSet<(String, Option) -> CheckCfg { rustc_span::create_default_session_if_not_set_then(move |_| { - registry_setup(); - let mut cfg = CheckCfg::default(); 'specs: for s in specs { -- cgit 1.4.1-3-g733a5