chore: eliminate thread_local!

This commit is contained in:
Shunsuke Shibayama 2023-06-10 16:07:50 +09:00
parent d6f30924f1
commit 393a018fb9
5 changed files with 63 additions and 84 deletions

View file

@ -15,6 +15,7 @@ use std::path::PathBuf;
use erg_common::config::ErgConfig;
use erg_common::consts::{DEBUG_MODE, ERG_MODE, PYTHON_MODE};
use erg_common::dict;
use erg_common::env::erg_std_decl_path;
use erg_common::error::Location;
#[allow(unused_imports)]
use erg_common::log;
@ -515,10 +516,6 @@ pub fn builtins_path() -> PathBuf {
erg_common::env::erg_pystd_path().join("builtins.d.er")
}
pub fn std_decl_path() -> PathBuf {
erg_common::env::erg_std_decl_path()
}
impl Context {
fn register_builtin_decl(
&mut self,
@ -667,7 +664,7 @@ impl Context {
let module = if &self.name[..] == "<builtins>" {
builtins_path()
} else {
std_decl_path().join(format!("{}.d.er", self.name))
erg_std_decl_path().join(format!("{}.d.er", self.name))
};
let abs_loc = AbsLocation::new(Some(module), loc);
self.register_builtin_impl(name, t, muty, vis, py_name, abs_loc);