Fix sync build.

This commit is contained in:
Stephen Chung
2022-01-28 22:07:49 +08:00
parent c93e94c7cd
commit c397a6dcb5
4 changed files with 19 additions and 12 deletions

View File

@@ -42,9 +42,13 @@ pub struct GlobalRuntimeState<'a> {
#[cfg(not(feature = "no_module"))]
pub embedded_module_resolver: Option<Shared<crate::module::resolvers::StaticModuleResolver>>,
/// Cache of globally-defined constants.
///
/// Interior mutability is needed because it is shared in order to aid in cloning.
#[cfg(not(feature = "no_module"))]
#[cfg(not(feature = "no_function"))]
pub(crate) constants: crate::Locked<std::collections::BTreeMap<Identifier, crate::Dynamic>>,
pub(crate) constants: Option<
crate::Shared<crate::Locked<std::collections::BTreeMap<Identifier, crate::Dynamic>>>,
>,
/// Debugging interface.
#[cfg(feature = "debugging")]
pub debugger: super::Debugger,
@@ -71,7 +75,7 @@ impl GlobalRuntimeState<'_> {
fn_hash_indexing: (0, 0),
#[cfg(not(feature = "no_module"))]
#[cfg(not(feature = "no_function"))]
constants: std::collections::BTreeMap::new().into(),
constants: None,
#[cfg(feature = "debugging")]
debugger: crate::eval::Debugger::new(_engine),
dummy: PhantomData::default(),