From a478d57e01d1cec7ff0a5141af710c57fe984581 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 30 Dec 2022 22:21:22 +0800 Subject: [PATCH] Fix builds. --- src/api/deprecated.rs | 4 +++- src/eval/data_check.rs | 3 ++- src/types/fn_ptr.rs | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/deprecated.rs b/src/api/deprecated.rs index 4dd7d703..dca53e94 100644 --- a/src/api/deprecated.rs +++ b/src/api/deprecated.rs @@ -1,7 +1,6 @@ //! Module containing all deprecated API that will be removed in the next major version. use crate::func::RegisterNativeFunction; -use crate::plugin::*; use crate::types::dynamic::Variant; use crate::{ Dynamic, Engine, EvalAltResult, FnPtr, Identifier, ImmutableString, Module, NativeCallContext, @@ -633,6 +632,9 @@ impl Module { } } +#[cfg(not(feature = "no_index"))] +use crate::plugin::*; + #[cfg(not(feature = "no_index"))] #[export_module] pub mod deprecated_array_functions { diff --git a/src/eval/data_check.rs b/src/eval/data_check.rs index 21dd0c54..57d3297a 100644 --- a/src/eval/data_check.rs +++ b/src/eval/data_check.rs @@ -66,14 +66,15 @@ impl Dynamic { mx += 1; match value.0 { + #[cfg(not(feature = "no_index"))] Union::Array(ref a, ..) => { let (a, m, s) = Self::calc_array_sizes(a); ax += a; mx += m; sx += s; } + #[cfg(not(feature = "no_index"))] Union::Blob(ref a, ..) => ax += 1 + a.len(), - #[cfg(not(feature = "no_object"))] Union::Map(ref m, ..) => { let (a, m, s) = Self::calc_map_sizes(m); ax += a; diff --git a/src/types/fn_ptr.rs b/src/types/fn_ptr.rs index 83539f83..155eaa27 100644 --- a/src/types/fn_ptr.rs +++ b/src/types/fn_ptr.rs @@ -371,6 +371,7 @@ impl FnPtr { /// of arguments to call it directly (one version attaches extra arguments). #[cfg(not(feature = "internals"))] #[inline(always)] + #[allow(dead_code)] pub(crate) fn call_raw_with_extra_args( &self, fn_name: &str,