mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:36:22 -04:00
fix(highlight): use std::sync::OnceCell for various loader fields
`std::unsync::OnceCell` allows for data races and requires an (incorrect) manual impl of the `Sync` trait.
This commit is contained in:
parent
8df22e6f0e
commit
fd0ccd65a5
|
|
@ -24,7 +24,7 @@ use etcetera::BaseStrategy as _;
|
|||
use fs4::fs_std::FileExt;
|
||||
use libloading::{Library, Symbol};
|
||||
use log::{error, info, warn};
|
||||
use once_cell::unsync::OnceCell;
|
||||
use once_cell::sync::OnceCell;
|
||||
use regex::{Regex, RegexBuilder};
|
||||
use semver::Version;
|
||||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
|
|
@ -633,8 +633,6 @@ impl<'a> CompileConfig<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
unsafe impl Sync for Loader {}
|
||||
|
||||
impl Loader {
|
||||
pub fn new() -> LoaderResult<Self> {
|
||||
let parser_lib_path = if let Ok(path) = env::var("TREE_SITTER_LIBDIR") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue